Sometimes it’s really helpful if you can ssh to your local VM from the host OS. Most of online tutorials suggests to use port forwarding, but NAT networking does not work for me even though I don’t know exactly why. So I switched to bridge netowrking and finally it worked, here are the steps.

Set Bridge networking

Make sure you’ve shutdown the VM, in the setting panel, Network -> Adapter 1 -> Attached to, select Bridge Adapter, save the setting by clicking OK.


Get VM IP and Host IP

Start your VM, type ifconfig in the terminal and check your IP address.


Back to your host, type ipconfig in the command line window (I assume that you are using Windows).


So host IP is and VM IP is, they are in the same network.

Check your SSHD service

Now you can type this from your host command line window.

ssh [USER]@[VM_IP]

If you get a “port 22: Connection refused error”, please check this post: Why am I getting a “port 22: Connection refused” error?. In short, install openssh-server if you need it, start it, enable 22/tcp in ufw, or disable ufw.

Once sshd is working, you should be able to connect to your VM from the host PC.