Page 1 of 1

Guest PXE booting from other guest

Posted: 3. Apr 2011, 07:10
by cad1llac
Vbox version: 4.0.4 with Extension installed
Host: Windows XP
Guest: Debian install/config server running FAI
Network: Guest bridged to Host 's wifi adapter

I initially installed Squeeze on the Guest server and configured it with the aim of PXE booting other guests. I network booted a second guest that is able to receive a static IP address by DHCP and access and boot a linux kernel via TFTP. However this boot process stalls when starting up the ethernet card just prior to completing the initial boot and mounting a root file system via NFS from the install server. I have tried each of the various VBox ethernet adapters without success. The boot process on the guest reports:
eth0: link up
Begin: Running /scripts/live-premount ... Waiting for ethernet card(s) up... If this fails, maybe the ethernet card is not supported by the kernel 2.6.32-5-486 done.
IP-Config: eth0 hardware address *MAC* mtu 1500 DHCP RARP
I then setup another Vbox VM Guest install/config server, this time with Lenny, to test whether this was an issue with either Squeeze/FAI not working well together or my configuration. This new Lenny server produced the same result.
eth0: link up
IP-Config: eth0 hardware address *MAC* mtu 1500 DHCP RARP
I have searched this forum and read the manual (multiple times for different issues). Manual says PXE booting supported in NAT mode (http://www.virtualbox.org/manual/ch06.html#nat-tftp). Some posts I've read seem to suggest PXE may be possible with bridged networking, so I'm a little confused as to whether what I am wanting to do is possible. Also, I'm not sure if bridging to a wifi adapter may be the cause of the problem. I don't think this is a DHCP issue (the booting guest is able to receive an IP address). I also could be an NFS issue although the problem appears to occur just prior to accessing the root file system via NFS.

I realise this may be an issue with the FAI install server setup and that this query may be better directed to the FAI developers. I will also be sending this post to them. However, I suspect it is more of a VBox networking/PXE issue, hence the post in this forum.

Basically, I'm relatively inexperienced (but keen to learn). Tech and sysadmin is not my profession and I am simply trying to set this up for my own private use and out of personal interest. I am quite new to linux but have a preferred system/network architecture (I use that term very loosely) I'd like to implement if at all possible. I would like to be able to setup an Linux (Debian) install/config server in a VM guest and make this accessible to other guests and other hosts.

If I've left any important details out let me know and I'll respond ASAP.

Thanks in advance.

Re: Guest PXE booting from other guest

Posted: 7. Apr 2011, 08:07
by mo0nykit
It's been a while since I tinkered with VirtualBox and Linux, and I haven't any experience with Debian distros other than Ubuntu. Anyway, I'll give it a try:

I think your network topology looks like this. In this case, your Client VM gets a DHCP from your Router, then perhaps your PXE routine, by default, looks for the boot image from the gateway (your Router). I'm not sure how to "tell" your PXE routine to look into 192.168.1.3, since your Client VM essentially doesn't know anything at all before getting an IP address and loading the boot image.

Code: Select all

Internet --> Router --> (eth0, 192.168.1.2) Host
                    --> (eth0, 192.168.1.3) Server VM
                    --> (eth0, 192.168.1.4) Client VM
Proposed solution:
I think the network topology should be like this:

Code: Select all

Internet --> Router --> (eth0, 192.168.1.2) Host
                    --> (eth0, 192.168.1.3) Server VM (eth1, 192.168.100.1, serving a DHCP) --> (eth0, 192.168.100.2) Client VM
If you follow my instructions below, you should get that network topology.

1. Server VM network cards:
eth0 should be a bridged adapter, meaning, it belongs to the same subnet as the host
eth1 should be an Internal Network Adapter. Assign this to a different subnet. "Internal Network Adapter" means that it is only applicable between VirtualBox VM's. Server VM should also serve DHCP over eth1
2. Client VM network card:
eth0 should be "connected" to eth1 of the Server VM. Imagine you are connecting a crossover LAN cable between them. This means that the Client VM eth0 should be an Internal Network Adapter, and belongs to the same subnet as the Server VM eth1.
I hope this helps. If you can confirm that your ethX cards belong to their rightful subnets, then probably the problem lies with the PXE implementation :?:

Re: Guest PXE booting from other guest

Posted: 11. Apr 2011, 10:33
by cad1llac
Thanks for your quick response, and very clear/simple explanation.

I've managed to set things up as you suggested. Using this configuration the boot process is able to start up the internal network adapter on the Client VM and then mount the root file system via NFS from the Server VM.
mo0nykit wrote:1. Server VM network cards:
eth0 should be a bridged adapter, meaning, it belongs to the same subnet as the host
eth1 should be an Internal Network Adapter. Assign this to a different subnet. "Internal Network Adapter" means that it is only applicable between VirtualBox VM's. Server VM should also serve DHCP over eth1
2. Client VM network card:
eth0 should be "connected" to eth1 of the Server VM. Imagine you are connecting a crossover LAN cable between them. This means that the Client VM eth0 should be an Internal Network Adapter, and belongs to the same subnet as the Server VM eth1.
I have also tried the following configuration:
1. Server VM network cards:
eth0: Attached to Internal Network. IP: Static 192.168.2.11.
eth1: Attached to Bridged Adapter. IP: DHCP from host.
2. Client VM network cards:
eth0: Attached to Internal Network. IP: DHCP Static address 192.168.2.20 from Server VM on 192.168.2.0 subnet.
eth1: Attached to Bridged Adapter. IP: DHCP from host.
For consistency I set eth0 on both VMs to the same Internal Network, and set eth1 on both VMs to be the Bridged Adapter giving access to the host and the internet. Also the reason for setting up a second adapter (eth1) on the Client VM is that ultimately this machine needs internet access once installed/configured. This configuration works fine, just as your previous suggested configuration does, with the Client VM able to request/receive an IP address from the Server VM and access the nfs root on the Server VM. In this way the FAI installation process is able to start up as planned.

However, one issue that remains outstanding is that the FAI install process requires that the Client VM have access to a Debian mirror. Perhaps the only way to achieve this is by setting up a local Debian mirror on the same subnet. Is this correct?

Might there also be a way to activate eth1 on the Client VM and have the FAI install process use that bridged network adapter to access a remote Debian mirror via http? Or is this a question better directed to the FAI developers?

Or is there perhaps a way for the Client VM to share the Server VM's internet connection via the Server VM's bridged eth1 adapter?

Re: Guest PXE booting from other guest

Posted: 12. Apr 2011, 01:48
by mo0nykit
I have no experience with FAI, but I'll assume it's similar to
apt-get
Good to hear that your were able to set it up. However, your setup is a bit different from mine.
My Client VM only has eth0, an Internal Network Adapter. It accesses the Internet through the Server VM. I can no longer quite explain how I did that, but I think it is well-documented in one of my threads from long ago (Diskless VM Internet access). In principle, I think it involves setting up my Server VM DHCP server to give out the correct gateway setting, in this case, my Client VM's IP address should be 192.168.100.2, and its gateway should be 192.168.100.1 (corresponding to the Server VM). In addition, the Server VM's connection to the outside world should be: IP address 192.168.1.3, gateway 192.168.1.1. Tracing from the Internet to my Client VM, it looks like this:

Code: Select all

Internet --> Router (192.168.1.1) --> (192.168.1.3) Server VM (192.168.100.1) --> (192.168.100.2) Client VM
Your Client VM has eth0 (Internal Network Adapter) and eth1 (Bridged Adapter, for Internet access). If you are successful in getting your Client VM to access the Internet through eth1, well and good. I would suggest going ahead with setting up your FAI installer to access the public Debian mirror via http.