1

I run a course that includes practical classes on system administration. For that years ago I created a Fedora 20 virtual image -- it need not be a modern and secure one as it is only for executing basic system administration commands. Students import that into VirtualBox.

The machine image has loopback and two other network interfaces: p2p1 to the Internet and p7p1 to the host machine. I would like the students to log in through that interface from a terminal emulator on the host Windows.

By

sudo dhclient p7p1

most of them is able to get an IPv4 address as shown here, a local 192.168. ... address:

enter image description here

Some of them don't. Their dhclient hangs and they do not get an IPv4 address.

A subset of them can log in from the terminal emulator on the host using the IPv6 address but others cannot and they cannot ping even the virtual machine by the IPv6 address.

Now, they have

  • the same hardware as their PC
  • the same Windows 7 from the same image file
  • the same version of VirtualBox
  • the same Fedora 20 image
    • including the same virtual disk image
    • and also the same network interface configuration

What can differ there and how can I get an IPv4 address for the virtual machine?

  • Are you sure you have different MAC addresses on all VMs? – Jaroslav Kucera Sep 27 '17 at 14:07
  • 1
    @JaroslavKucera Not, quite in the contrast: I guess they are all the same. But this is a host-only interface so I guess VirtualBox acts as a DHCP server. All the students have their own PC with only one VM. – Gergely Sep 27 '17 at 14:13
  • Is it possible to try this with a newer dhclient from a newer Fedora release, even if you can't update the whole image? – mattdm Sep 28 '17 at 13:42
  • @mattdm: I'll give it a try – Gergely Sep 28 '17 at 17:35
  • @mattdm the updated dhclient did not solve the problem, but tweaking the host's VirtualBox did, see my answer – Gergely Nov 15 '17 at 14:51
1

It turned out from the debugging mode of

sudo dhclient -d p7p1

that VirtualBox's DHCP server did not provide an IPv4 address to the Host-Only Interface (p7p1).

On the #virtualbox irc channel I got the advice

[15:25] <@klaus-vb> could be that the dhcp server has lost track of  vms... 
that can be solved by stopping all VMs, and making sure that neither VBoxSVC nor VBoxDHCP 
(or how it's called exactly) is running. then re-start the VMs. 
I think this was a bug fixed in later 5.1 versions...

My students stopped their VMs, killed these VBoxNetDHCP.exe and VBoxSVC.exe processes, restarted their VMs and then

sudo dhclient -d p7p1

worked and they got a proper IPv4 address.

So, after all, this was a VirtualBox only problem on the host machine.

Your Answer

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

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