access ubuntu’s nfs rootfs using a WiFi connection

How to get an ubuntu booting from an NFS share accessible only by a WiFi/WLAN adapter?

You have to modify the initialramfs:

  • include the WiFi module
  • initialize the adapter (essid, key, type of encryption)
  • request a DHCP lease

Because ubuntu seems to have a problem with firmware loading I had to copy a udev rule and the firmware load shell script to the initramfs.

/etc/network/interfaces may not contain the wlan device!

The informations needed by initramfs to be able to configure the wlan device are provided by passing the parameters to the kernel (wkey=foo wessid=bar and so on). Please consider that the command line arguments (essid, encryption key, …) can be seen by any user that has access to the booted machine!

My kexec kernel passed these informations it gots from the pxelinux configuration to the (by kexec) started kernel automaticaly.

To get your ubuntu booting from a WiFi rootsfs you can download the additions I made to the initramfs extracting the tarball from http://sourceforge.net/projects/s100-wifi-boot/files/ and rebuild the initramfs by calling update-initramfs -vck all

Because I got problems with NFS timeouts (compare the latency/speed of a ethernet link and a WiFi link) my pxelinux configuration looks like this:

LABEL linux
KERNEL IMAGES/s100-mpd/vmlinuz
APPEND root=/dev/nfs initrd=IMAGES/s100-mpd/initrd.img nfsroot=192.168.1.1:/tftpboot/PXEClient/IMAGES/s100-mpd/ NFSOPTS=”-o ro,nolock,wsize=2048,rsize=2048,timeo=140″ verbose

(the default timeout value is 7 so I increased it by a factor of 20!)

Advertisements
This entry was posted in WiFi/Netboot and tagged . Bookmark the permalink.

5 Responses to access ubuntu’s nfs rootfs using a WiFi connection

  1. paolo says:

    You are a genius.
    Can you please help me to find a way to resolve my situation?
    I have two x86 laptop (both acer).
    On the first machine (let’s call it server) i’ve installed ubuntu 14.04 and the package ltsp-server-standalone and have configured for ethernet boot via PXE.
    On the second machine (client) I’ve installad ubuntu 14.04.

    If I enable netboot from the client bios i can have a sort of thin client working.
    What I need is to do the same thing, but wireless and without a router (ad-hoc connection).
    iPXE doesn’t support my broadcom (it was the best solution i think) so I think I have to use something like pxe-kexec from a booted ubuntu.
    It’s not so well documented in internet and i could not find a good wiki.
    Then I saw your project and “WOOOW”!! It’s the same thing I want.

    So:
    considering the hardware I have to use: what is the best thing in your opinion and above all, can you please help me to configure that server-client wireless ad-hoc system?

    Thank you so much in advance and thank you for your grate work. It makes me hope that i’m finally on the right way.

    Paolo Dino Oddone
    Fossano (CN) – Italy

    p.s. look for me on skype if you want, I will be very happy. paolo.dino.oddone

    • Peter Fichtner says:

      Does hostapd rel=”nofollow”>hostapd/ solve your problem?
      With hostapd you could turn your server into a WiFi Acess Point

      • paoloddone says:

        can you please link me a tutorial to pxe-kexec? I can’t understand the man page.
        Thank you

      • paoloddone says:

        Ok I don’t know how to edit/delete my posts. If you want do it for me.
        Then:
        I’m in. I’m very near to the goal.
        difference is that for now i’m trying to do the same you describe, but manually, starting from a ubuntu. My pxelinux.cfg default contains this:

        label koro
        menu label LTSP koro, using NFS
        kernel vmlinuz-3.13.0-23-generic
        append ro initrd=initrd.img-3.13.0-23-generic init=/sbin/init-ltsp vt.handoff=7 root=/dev/nfs ip=dhcp boot=nfs
        ipappend 2

        when i type in client terminal:

        sudo pxe-kexec -i wlan1 -n -l koro 10.42.0.1

        it download kernel and initrd, but when it’s time to reboot it freeze. I think it’s becouse my client doesn’t find what to boot, isn’t it?

        what if I append

        APPEND root=/dev/nfs initrd=opt/ltsp/i386/boot/initrd.img nfsroot=10.42.0.1:/opt/ltsp/i386 NFSOPTS=”-o retrans=10,tcp” ro,nolock,wsize=2048,rsize=2048,timeo=140″ verbose
        ?
        I’m groping in the dark, but with your help I can see the light.
        doing this how can tftp client find again the tftp server after reboot if i do not append also access point configuration? Where is supposed to type those configuration?

        Lots of question, I know.
        Thanks again

  2. paolo says:

    My server is a WiFi Access Point yet (with wpa password and all works great). The fact is: I don’t know how to use pxe-kexec. It’s well documentated, I know, but i need some pratical example to understand what I have to do.
    I connect client laptop to my server Access Point laptop via wifi and that first passage works just well (internet connection shared, no problem at all).
    Then I try to run on the thin client terminal:

    $ sudo pxe-kexec

    the result is (obviously):

    No TFTP server specified and also no DHCP server in the DHCP info file
    (/var/lib/dhcpcd/dhcpcd-.info).

    So:
    first of all I did not found that dhcpcd-.info file, but i know that it’s possible to add option to pxe-kexec to make it point in the right direction. In internet I’ve found something like

    $ sudo pxe-kexec mydhcp.mydomain.com

    Surely I’m very ignorant, but… What the f**k I have to do with that?
    That’s it.
    Anyway Peter, if you will help me try to find the way, I will appreciate SO much.
    I feel like an Hoompa Loompa without chocolate…
    Or like a man without his wifi ltsp connection…
    You know…. It’s very sad.

    Thank’s in advance
    Paolo

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s