0

I am using ubuntu 18 minimal image to create a ubuntu server with virtual box. I created a host only network and added adapter to vm along with NAT adapter (already configured).

original configuration of netplan was following.

network:
  version: 2
  renderer: networkd
  ethernets:
    enp0s3:
      dhcp4: yes

I changed this configuration to following to enable host only adapter (enp0s8)

network:
  version: 2
  renderer: networkd
  ethernets:
    enp0s3:
      dhcp4: ye
    enp0s8:
      dhcp4: no
      addresses: [192.168.56.101/24]
      gateway4: 192.168.56.1

Now I am successfully able to access vm from host machine over network. but internet inside vm stops working :(. I have tried so many different solutions but either I get internet working (provided by NAT adapter) by disabling host only adapter, or can access vm from host by enabling host only adapter.

I suspect vm is trying to connect to internet via host only adapter. How can I change this?

  • Delete the host-only adapter. Host-only is NOT a useful answer for your use case. Your problem is how to create a network connection from host to guest using NAT. – user535733 Sep 21 at 19:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.