I'm running an Ubuntu 20.04 VM via VirtualBox on MacOS. I've got two network interfaces set up. One of it them is a bridged connection and the other set for "internal network". I prefer to SSH into the VM from my terminal instead of using VirtualBox's interface. Normally, this isn't a problem as both my Mac and my VM are hooked up to the same Wi-Fi network.

However, I would imagine that there's a way to SSH even without a larger network. When I run ip addr on my VM, I see

2: enp0s3: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 08:00:27:c2:f9:eb brd ff:ff:ff:ff:ff:ff
3: enp0s8: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 08:00:27:fb:e3:1a brd ff:ff:ff:ff:ff:ff

I can't SSH using either IPv6 address and even running ping6 against them informs me that there's no route to host.

2 Answers 2


You should use host-only adapter instead and map it to your guest interface.

You should create new adapter in virtual box settings then map the nic to this adapter on the guest vm settings.

  • There are none to attach to. That is, the only option for the "Name:" field is "Not selected". Dec 14, 2020 at 23:59
  • 1
    You should create new adapter in virtual box settings then map the nic to this adapter on the guest vm settings.
    – Reda Salih
    Dec 15, 2020 at 0:03
  • 2buntu.com/articles/1513/…
    – Reda Salih
    Dec 15, 2020 at 3:19

I remember needing this on a train ride, where I could not SSH into my machine without Wi-Fi. I'll explain the steps I used to configure this on my VirtualBox running on a Windows 10 host. Three things may be needed:

  1. Add a Host-Only Network in VirtualBox.

  2. Add a new adapter in the Virtual Machine and connect it to the Host-Only Network.

  3. Configure the new network adapter to get an IP address.

Add a Host-Only Network

In VirtualBox 6.1 I created a Host Network in the UI by going to File > Host Network Manager. See the Oracle documentation for more. I ticked the options to configure the adapter automatically and enable the DHCP server.

Add a New Adapter to the VM and Connect to the Host-Only Network

My VM only had one adapter enabled. In the VM network settings I went to Adapter 2 tab and ticked "Enable Network Adapter" then selected "Attached to: Host-only Adapter" and "Name: VirtualBox Host-Only Ethernet Adapter". This may be different in your UI. Now if I run ip a (shortcut for ip address) I can see the new adapter as enp0s8. The first one is still there, as enp0s3.

Configure the Network Adapter in The VM

My adapter showed up as being DOWN so the first thing I did was to bring it UP:

sudo ip link set enp0s8 up

Still, ip a showed no IP address, despite the interface being up. This means it's not automatically using DHCP and I have to configure it to do so. See below what I did on my Ubuntu system. It may be different for your distribution or if you want a static IP instead.

Added the following two lines to /etc/netplan/00-installer-config.yaml:

  dhcp4: true

So it now looks like this:

      dhcp4: true
      dhcp4: true
  version: 2

This was followed by:

sudo netplan --debug generate
sudo systemctl restart systemd-networkd

After this I could see the IP address on the enp0s8 interface with ip a and I can use it to SSH into my virtual machine from Windows Terminal, even in airplane mode!

Troubleshooting: I have found that this solution is not very stable. Sometimes I can still ping the VM from the host using the bridged adapter IP but not the host-only network IP. Restarting the interface, the VM or even virtualbox, etc. didn't fix anything, but the cliché of restarting Windows restored the functionality. My suggestion is, if this stops working, restart Windows first.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .