Using Hamachi to connect to my local VM from a distant computer

0

I have a virtual machine running Debian hosted on my Mac. I use it to develop and host a server. I also have a distant PC which I use to play my games. I'd like to connect to my server running on my VM. The thing is, as you can imagine, my Mac is not on the same network as my distant PC.

My question is simple : How can I make my VM available from my distant PC?

I was thinking of using Hamachi, but my VM doesn't have any graphical user interface. Is it enough to use Hamachi on my Mac (that hosts my VM) and on my PC with a bit of port forwarding?

Is there an easier way to achieve my goal?

Pierre Pasquet

Posted 2018-09-27T21:38:23.327

Reputation: 1

If there are specific ports you need, then possibly you could ssh to the Debian VM and set up ssh tunnels. Also, it appears that Hamachi has a command-line client, so can you use that? – jamesdlin – 2018-09-28T14:42:46.410

Answers

0

You can use hamachi to connect to your mac from your pc. Once you are connected to hamachi, you can use VNC yo graphic connect to your mac and access to your VM. But you better can connect ssh directly from your PC (putty does it) to your VM. It depends on the network config you made on the VM. By the way you can use prefixed ip provided by Hamachi for accesing machines on the VPN network. Example 1:MAC

  • IP:192.168.1.100
  • DEBIAN IP: 192.168.200.3
  • PC IP: 192.168.1.30
  • PROVIDED HAMACHI IP: 10.34.1.30

You could access debian directly to ip 192.168.200.3 (Mac should route it correctly) Example 2:

  • MAC IP:192.168.1.100
  • DEBIAN IP: 192.168.1.200
  • PC IP: 192.168.1.30
  • PROVIDED HAMACHI IP: 10.34.1.30

You could access debian with IP: 10.34.1.200

Abraham

Posted 2018-09-27T21:38:23.327

Reputation: 75