0

I have installed a VirtualBox with an Ubuntu Server (16.04)on my Ubuntu 16.04 laptop.

I want to create a virtual network. By reading some post on the web, it seems pretty simple but ...

So, I have configured like that:

  • In VirtualBox settings > network: NAT is empty, and in Host Only, I have vboxnet0 with 192.168.56.1 as IP, 255.255.255.0 as mask and DHCP empty
  • I setup the virtual server, with card 1 = NAT and Private Host with name vboxnet0 and Authorize all. Checkbox cable plugged is tick on.

  • File /etc/network/interface contain this informations:

    auto lo iface lo inet loopback

    auto enp0s3 iface enp0s3 inet static address 192.168.26.70 netmask 255.255.255.0 network 192.168.56.1 gateway 192.168.56.1 dns-nameservers 8.8.8.8 8.8.4.4

I try to ping host and guest but nothing is working. I miss something but what ?

Thanks for your help

UPDATE 1 Screenshots about configuration ifconfig on VM Settings /etc/network/interfaces

I know I miss something but what?

  • I need more info to help you....do you need internet on that VM? – lewis4u Sep 15 '16 at 9:15
  • Yes. When I ping google it is working. If I ping hosting machine it is also working. But whenever I ping guest from host it says Unreachable. – Jonathan Lebrun Sep 15 '16 at 9:19
  • did you try it? – lewis4u Sep 15 '16 at 9:31
  • @lewis4u not yet. I will do it this evening (I am in Europa ;-) . And I will give you a feedback immediately afterward. Thanks a lot for your advice. – Jonathan Lebrun Sep 15 '16 at 9:34
  • @lewis4u no, it doesn't work. I added some screenshots – Jonathan Lebrun Sep 15 '16 at 17:59
1

You need to set your network adapter to bridged and for Name: choose your host NIC - your wireless or LAN connection adapter from laptop.

Mine is Intel Centrino Wireless-N 1000

Instead of that choose yours.

and press the MAC Adress refresh button (on the right the blue one with arrows) a few times![enter image description here

  • I don't have the same Name but wslxxx (see my update). Thanks a lot – Jonathan Lebrun Sep 15 '16 at 18:00
  • It is working fine with Bridged Adapter but it is not really I have to do. I want to create a internal network not in the same host network. – Jonathan Lebrun Sep 17 '16 at 10:56
  • when you create internal network that network doesn't have connection with your host.....it is isolated! you need to have two VM machines and connect them....and that is internal network....if you need more info, write here – lewis4u Sep 17 '16 at 21:10
  • Ok. Thanks a lot. I will try it tomorrow and I'll give you a feedback – Jonathan Lebrun Sep 17 '16 at 21:35
  • You can see an explanation of all 3 basic types of networking for VirtualBox - Just a hint when he says "Instance" that is actually the virtual machine!!! youtu.be/AiWRmMzwwJM?t=1182 – lewis4u Sep 18 '16 at 11:14
0

If you want

  1. to be able to ping the host
  2. to have a private IP belonging to a private network

then, as suggested above by lewis4u's answer's comments, you need to create an Internal network instead of a Bridged network:

Network adapter 1: interface to the host network adapter 2: interface to the Internal network

Then you should get two interfaces, one NATed and thus connected to the Internet (if your host is), and one allowing to communicate within the internal network.

PS: your line "network 192.168.56.1" in /etc/network/interfaces seems extraneous (look man 5 interfaces).

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.