4

I am following this HowTo on setting up a diskless ubuntu client.

  1. I am using 2 virtualbox VMs one server and one client.
  2. I am trying to boot the client using pxe but I get a kernel panic error like THIS
  3. I am using Ubuntu 16.04.3 LTS (Xenial Xerus) on both server and client.
  4. The server is a FULL install while client is minimal install.

The client connects to the server, gets an IP and the boot process starts but then i get a kernel panic error. Please tell me what I am doing wrong here. I have followed the tutorial word by word.

Here is my setup:

Ubuntu Server has dhcp server configured for pxe boot.

I ran the following commands on minimal ubuntu client:

  1. sudo cp /boot/vmlinuz-uname -r ~
  2. Changed the BOOT flag in /etc/initramfs-tools/initramfs.conf to BOOT=nfs
  3. Changed the MODULES flag in /etc/initramfs-tools/initramfs.conf to MODULES=netboot
  4. Put modules needed for network adapters into /etc/initramfs-tools/modules
  5. Ran mkinitramfs mkinitramfs -o ~/initrd.img-uname -r
  6. Copied OS files to Ubuntu server (192.168.2.3/nfsroot/):
     mount -t nfs -onolock 192.168.2.3:/nfsroot /mnt 
     cp -ax /. /mnt/.
     cp -ax /dev/. /mnt/dev/. (This command didn't work)
    
  7. Copied kernel and initrd to tftp root.
  8. /tftpboot/ now contains vmlinuz and initrd image made in step 5
  9. Configured fstab on /nfsroot/etc/fstab. It contains the information the client will use to mount file systems on boot.

/nfsroot/etc/fstab

proc /proc proc defaults 0 0
/dev/nfs / nfs defaults 1 1
none /tmp tmpfs defaults 0 0
none /var/run tmpfs defaults 0 0
none /var/lock tmpfs defaults 0 0
none /var/tmp tmpfs defaults 0 0
/dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0

/tftpboot/pxelinux.cfg/default

LABEL linux
DEFAULT vmlinuz-4.10.0-28-generic
INITRD initrd.img-4.4.0-87-generic
APPEND root=/dev/nfs nfsroot=192.168.2.3:/nfsroot ip=dhcp rw

/etc/default/tftpd-hpa

TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/tftpboot"
TFTP_ADDRESS=":69"
TFTP_OPTIONS="--secure"

/etc/default/dhcp/dhcpd.conf

allow booting;
allow bootp;
subnet 192.168.2.0 netmask 255.255.255.0 {
  range 192.168.2.5 192.168.2.250;
  option broadcast-address 192.168.2.255;
  option routers 192.168.2.10;
  option domain-name-servers 192.168.2.11;
  filename "pxelinux.0";
}
# force the client to this ip for pxe.
# This is only necessary assuming you want to send different images to differen$
host pxe_client {
  hardware ethernet 00:00:00:00:12:34;
  fixed-address 192.168.2.7;
}

PLEASE HELP!!!

0

Your /tftpboot/pxelinux.cfg/default file is wrong. It must be something like this: (just example, but kernel and initrd versions must be the same and the initrd is those, that was generated with mkinitramfs)

LABEL linux KERNEL vmlinuz-2.6.15-23-686 APPEND root=/dev/nfs initrd=initrd.img-2.6.15-23-686 nfsroot=192.168.2.2:/nfsroot ip=dhcp rw

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.