Montag, 20. Mai 2013

booting from network

In the lab, I can boot any server from the network. This allows me to start up any distribution I like. Also it is possible to install Linux by booting via the network as I describe in 3 ways to install Linux. The technology to  boot from the network is called PXE, preboot execution environment. Today I want to use it for my virtual machines. The setup looks like this:


On my main computer I use SUSE Linux.

DHCPD setup

A dhcp daemon assigns a dynamic IP address to a computer that connects to the network. The PXE technology requires this, so let's set up a DHCP server (daemon) on the main computer. Open a console as root and call:
yast -i dhcp-server
Make sure it listens on network device eth1. To do this, open /etc/sysconfig/dhcp, set 
DHCPD_INTERFACE=eth1
We don't use eth0. eth0 gets its IP address from the router which interferes with our goal.

Configure DHCP with a file /etc/dhcpd.conf:
subnet 192.168.0.0 netmask 255.255.255.0
{
   range 192.168.0.10 192.168.0.100;
   next-server 192.168.0.1;
   filename "pxelinux.0";
}

Start dhcpd using the command
/etc/init.d/dhcpd start
Activate dhcpd start on boot using the command
chkconfig dhcpd on

TFTP setup

TFTP, the trivial File Transfer Protocol, allows for transmitting bootcode over the network. Install the server using the command:
yast -i tftp
Then edit /etc/xinet.d/tftp, replace
disable = yes
by
disable = no
Then restart xinetd, the service hosting tftp:
/etc/init.d/xinetd restart
Now test your tftp server using the command
tftp localhost -c get pxelinux.0
There should not be any error message from this command. Then activate xinetd start on boot:
chkconfig xinetd on 

RIPLinux setup

RIP Linux is a distribution optimized for (recovery and ) PXE.
cd /srv
wget http://www.tux.org/pub/people/kent-robotti/looplinux/rip/RIPLinuX-13.7.PXE.zip
unzip RIPLinuX-13.7.PXE.zip

VirtualBox setup

VirtualBox allows you to create and run virtual machines. These virtual machines can boot from LAN (local area network). To set it up, open a console as root and call:
yast -i virtualbox
or, depending on your SUSE version
yast -i virtualbox-ose
Start it with the command
VirtualBox
Then create a virtual machine by clicking onto the "New" Button.

Now select your new virtual machine, click on "Settings" -> "Network". You want to make it a bridged adapter (in my case bridge to eth1) and select "advanced" -> "Adapter Type". As adapter type, set PCnet-Fast III, even if this is not build into your computer. If you do not select this, PXE will not work:

To boot your virtual machine from network (LAN), click on "Start", then type F12, then L.

Raspberry Pi, test my internet connection

Since start of Corona times, I use my internet at home also for work. So its reliability and performance has become crucial. Performance see...