PXE boot opensuse 11.4

Hello,

I was just wondering if anyone has ever successfully set up a live cd PXE boot environment. Essentially, a computer would start, enter pxe boot mode, find the server and would pull the initrd and kernel from a server and then start booting. Any files it would need would come from nfs… I have done it with ubuntu, but would like to be able to do this with opensuse.(if i need to, i have access to suse studio). Any input would be appreciated.

I currently have an ubuntu server which has this functionality, but as already stated, if i can find all the software i need, i can make a server from susestudio and then use that.

openSuSE version- 11.4 32 bit KDE

thanks,

On 09.10.2011 15:56, vader95 wrote:
>
> Hello,
>
> I was just wondering if anyone has ever successfully set up a live cd
> PXE boot environment. Essentially, a computer would start, enter pxe
> boot mode, find the server and would pull the initrd and kernel from a
> server and then start booting. Any files it would need would come from
> nfs… I have done it with ubuntu, but would like to be able to do this
> with opensuse.(if i need to, i have access to suse studio). Any input
> would be appreciated.
>
> I currently have an ubuntu server which has this functionality, but as
> already stated, if i can find all the software i need, i can make a
> server from susestudio and then use that.
>
> openSuSE version- 11.4 32 bit KDE
>
> thanks,
>
>
I haven’t tried this (not even read it through) but here’s something:
http://beginlinux.com/desktop/opensuse/opensuse-pxe-boot

Vahis

openSUSE 11.4 (x86_64) 2.6.37.6-0.7-default main host main host
openSUSE 12.1 Beta 1 (x86_64) 3.1.0-rc7-3-desktop in VBox
openSUSE 11.4 (i586) 3.0.4-43-desktop “Tumbleweed” in EeePC 900

Thanks, but that is to install a system. I want to run a diskless client with a live cd pulled from a server.

Thanks again,

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The principals should all be the same. Basically you’re telling your
system to boot from the network, whether it’s to install (loading yast)
or to boot (loading init and all of the other init-started services,
GUIs, etc.). As long as the computer can find the stuff needed to start
the boot process it should all work. I’d probably use Google to find
how it should work for Linux in general (or compare with your Ubuntu
box) and then setup the LiveCD or whatever else to match that
specifically, finally configuring the PXE system to point to that
location where NFS shows the LiveCD contents.

Good luck.


Want to yell at me in person?
Come to BrainShare 2011 in October: http://tinyurl.com/brainshare2011
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJOkaTaAAoJEF+XTK08PnB5XoEQANTkYeC/FrDzHrDl0hYr6j10
nQbhrI6mS8X6qBJL1EVsPTcxLXsV2X+jrCg5ABzDtOZCxSNg1O0YHsD0ofVQKHth
aQy19kUaxuYv04g+lGbesUB1O7MQR/hEncL4Tn8/oZhX5MsfNfLuq+cTbnldZVY4
bhLzht6XY9EfA4Tl9c+ZpxJsDysGQEVxKw8DJOQhSc5/mRiWtX0rrfTzytUN3c2g
nc1CXBlD2K/5UJHcsezc0eL2NuckBUIXM0l+n+13ryvkk6rKi3B8rqIxlZJ352l8
V5vPUFqaQeXh2VdOIfYvCZaq2IhoRATh8hfzDh/VWPSuAjHWFLSW4FZmxyUYSqoB
Rl2JitMiCQ25FB984t1euixMIER1UwsJwqbXEYa/+If+1FQBJpj8BcFDAXgevbnW
hxw1S3BKjpSAicGtoCCzzZW5cClbO9p3v6/bsJaYYxkWWRFARUkEoeNS+6AM4k89
JWNyOioPZ42qxAverIO+Q4Wj7UmorgbuOu1LiFqxbR131Cb3hM4AdbmVpEddv5Bi
pZbam4yruNcFzKoG1/HNUV4nxim3+A5CBMHyKtxI6yVjka3werYrfJ+H4IxlpxHn
JROJXWY3BuEGz2CNy18TfFWTiJD0TC2DEBkx7NxfbEL3JfLi4HshdKucu+nLOiRs
4vR2Y5fPz4T5+gfhRUmB
=b1pl
-----END PGP SIGNATURE-----

that’s what i thought too, but it gets stuck at the kiwi disc loading system.

Thank you for your input though,

bump… anybody have any other ideas? Really i need to find a way to bypass kiwi.

I’m not sure what exactly you are booting, but if it is a simple kernel and initrd, you can use iPXE to pull both of these via TFTP, HTTP, etc. and boot them directly. iPXE is very flexible, and the boot process can be scripted, etc.:

iPXE - open source boot firmware [start]

If you are looking at booting a full LiveCD - I believe you can do this with Cobbler:

https://fedorahosted.org/cobbler/wiki/HowToPxeAnyLiveCd

Cheers,

Thank you i will look into that, but i don’t know if it will stop KIWI. Instead of loading opensuse when i pull the initrd and kernel it gets stuck at KIWI loading the disk loading system.

Hi there,

Sorry, I may have misunderstood. I thought you wanted to move away from KIWI and just PXE boot a client into some arbitrary kernel / initrd that you wanted, or a liveCD via PXE.

I’m not that familiar with Kiwi - only test drove it once, so I’m not quite sure what you mean when you say it gets stuck loading the disk loading system.

If you want to move away from Kiwi, there are lots of options. I believe with Kiwi the compute load is actually done on the server, not on the client is this correct? That was my experience with it a couple years back: Kiwi-LTSP

I decided I would rather use PXE to boot clients to an environment where all compute was run locally. To this end I have had great success PXE booting light weight Linux distros (RIP Linux is great for this), and it should be possible to PXE boot a full, client-based, OpenSuse instance (or LiveCD) as well, rather than the “kiwi way”

I don’t know if any of this helps really, but I thought I would just share my experiences.

Cheers,

Hi vader95,

I found this thread while looking for solutions of kiwi-problems. Is this still of interest for you?

I have the feeling that I’m just doing what you are asking for in your original posting, with the exception that my root filesystem is served via nbd (network block device) instead of nfs. So if this is of any help for you or anyone else stumbling across this thread: This is how I create and boot pxe images for/of openSUSE 11.4:

You need kiwi installed to create a boot image, so do

zypper in kiwi kiwi-desc-netboot syslinux atftp

Maybe you need more, I have these packages

kiwi kiwi-{config-openSUSE,desc-{net,iso,usb}boot,doc,instsource{,-plugins-openSUSE-11-{1,2,3}},tools}

installed.

Create /tmp/kiwi/descr/config.xml with this content (change the package list according to your needs):


<?xml version='1.0' encoding='utf-8'?>

<image name="yarny" schemaversion="5.2">
  <description type="system">
    <author />
    <contact />
    <specification />
  </description>
  <preferences>
    <type boot="isoboot/suse-11.4" flags="clic" hybrid="true" image="iso" />
    <type boot="netboot/suse-11.4" filesystem="clicfs" image="pxe" />
    <rpm-check-signatures>false</rpm-check-signatures>
    <timezone>UTC</timezone>
    <packagemanager>zypper</packagemanager>
    <version>0.0.0</version>
    <rpm-force>true</rpm-force>
  </preferences>
  <users group="root">
    <user home="/root" name="root" pwd="" />
  </users>
  <users group="users">
    <user home="/home/tux" name="tux" pwd="" />
  </users>
  <repository type="yast2">
    <source path="opensuse://11.4/repo/oss/">
  </repository>
  <packages patternType="plusRecommended" type="image">
    <!-- These packages might be important for system operation -->
    <package name="procinfo" />
    <package name="grub" />
    <package name="iputils" />
    <package name="vim" />
    <package name="sysconfig" />
    <package name="file" />
    <package name="netcfg" />
    <package name="syslinux" />
    <package name="kernel-default" />
    <package name="ifplugd" />
    <package name="dbus-1" />
    <package name="pam-config" />
    <package name="python" />
    <package name="gawk" />
    <package name="virtualbox-guest-kmp-default" />
    <package name="virtualbox-guest-x11" />
    <package name="sysfsutils" />
    <package name="dhcpcd" />
    <package name="ConsoleKit" />
    <package name="module-init-tools" />
    <package name="binutils" />
    <opensusePattern name="enhanced_base" />
    <!-- These packages I need for maintenance -->
    <!--
    <package name="NetworkManager-openvpn"/>
    <package name="NetworkManager-pptp"/>
    <package name="cnetworkmanager"/>
    <package name="atftp"/>
    <package name="btrfsprogs"/>
    <package name="cabextract"/>
    <package name="lighttpd"/>
    <package name="curlftpfs"/>
    <package name="dhcp-server"/>
    <package name="ipw-firmware"/>
    <package name="kiwi-desc-isoboot"/>
    <package name="kiwi-desc-netboot"/>
    <package name="kiwi-desc-usbboot"/>
    <package name="kiwi-instsource-plugins-openSUSE-11-3"/>
    <package name="memtest86+"/>
    <package name="lynx"/>
    <package name="nano"/>
    <package name="nbd"/>
    <package name="nfs-kernel-server"/>
    <package name="openvpn"/>
    <package name="screen"/>
    <package name="smpppd"/>
    <package name="socat"/>
    <package name="sshfs"/>
    <package name="vim-data"/>
    <package name="vsftpd"/>
    <opensusePattern name="console" />
    -->
    <!-- Some space wasting graphical desktop environments -->
    <!--
    <opensusePattern name="x11" />
    <package name="icewm-default"/>
    <opensusePattern name="xfce" />
    <package name="NetworkManager-openvpn-gnome"/>
    <package name="NetworkManager-pptp-gnome"/>
    <opensusePattern name="kde4_basis" />
    <opensusePattern name="kde4" />
    -->
  </packages>
  <packages type="bootstrap">
    <package name="filesystem" />
    <package name="glibc-locale" />
  </packages>
</image>

Create /tmp/kiwi/descr/config.sh:


#!/bin/sh

test -f /.kconfig && . /.kconfig
test -f /.profile && . /.profile

baseStripDocs
baseStripInfos
#baseStripLocales
baseStripMans

# Setup baseproduct link
suseSetupProduct


# Activate services
suseActivateDefaultServices
suseInsertService boot.device-mapper  # From kiwi iso example
suseInsertService xdm
baseSetRunlevel 3

# Remove cached packages
find /var/cache -iname '*.rpm' -type f -print0 | xargs --null rm --force

# Lift some access restrictions
sed -i -e "s/ALL ALL=(ALL) ALL/ALL ALL=(ALL) NOPASSWD: ALL/" /etc/sudoers
chmod 0440 /etc/sudoers
for k in $(ls /home) root
do
  passwd -d $k  # Empty passwords for all users with a homedir
done
pam-config -a --nullok         # Empty passwords are ok
echo 'tty7' >> /etc/securetty  # Root may use xdm


# Set correct ownership of home directories
for k in $(ls /home)
do
  chown $k: -R /home/$k
done

# Fix hosts
cat >> /etc/init.d/boot.local << eof
echo "127.0.0.2  linux  linux.site" >> /etc/hosts
eof

# Enable root login in xdm
if  -f /etc/X11/Xresources ]
then
cat >> /etc/X11/xdm/Xresources << eof
xlogin*login.allowNullPasswd: true
xlogin*login.allowRootLogin:  true
eof
fi

# SuSEconfig
if  -f /usr/bin/kdm ]
then
  dm=kdm
else
  dm=xdm
fi
if  -f /usr/bin/startxfce4 ]
then
  wm=startxfce4
elif  -f /usr/bin/icewm ]
then
  wm=icewm-session
else
  wm=twm
fi
baseUpdateSysConfig /etc/sysconfig/windowmanager DEFAULT_WM $wm
baseUpdateSysConfig /etc/sysconfig/displaymanager DISPLAYMANAGER $dm
baseUpdateSysConfig /etc/sysconfig/displaymanager DISPLAYMANAGER_ROOT_LOGIN_LOCAL yes
baseUpdateSysConfig /etc/sysconfig/network/config WAIT_FOR_INTERFACES ""
baseUpdateSysConfig /etc/sysconfig/network/config NETWORKMANAGER no
baseUpdateSysConfig /etc/sysconfig/clock HWCLOCK -u
baseUpdateSysConfig /etc/sysconfig/sysctl ENABLE_SYSRQ 1


# Final SuSEconfig, unmount root tree
suseConfig
baseCleanMount

exit 0

Credit where credit is due: I plugged this script together from some of the scripts that come with the kiwi-doc examples.

From now on you will have to work as root. Do


$ kiwi --prepare /tmp/kiwi/descr --root /tmp/kiwi/root
$ mkdir /tmp/kiwi/pxe-dest
$ kiwi --create /tmp/kiwi/root --type pxe --destdir /tmp/kiwi/pxe-dest

Congratulations: Your pxe boot image is ready.

Create the directory /tmp/kiwi/atftproot and create these directories/symlinks in there:


KIWI/
initrd -> /tmp/kiwi/pxe-dest/*.gz
linux -> /tmp/kiwi/pxe-dest/*.kernel
pxelinux.0 -> /usr/share/syslinux/pxelinux.0
pxelinux.cfg/

Pick the right files for *.gz and *.kernel: There is only one .kernel file, for the .gz, don’t link to the splash.gz file!
Also edit KIWI/config.default:


NBDROOT=10.250.0.10;4024;/dev/nbd0
UNIONFS_CONFIG=/dev/ram1;/dev/nbd0;clicfs

and pxelinux.cfg/default


Label kiwi
  Linux linux
  Initrd initrd
  Append splash=off vga=normal kiwiserver=10.250.0.10

Also create /tmp/kiwi/dchpd.conf:


pid-file-name "/tmp/kiwi/dhcpd.pid";
lease-file-name "/tmp/kiwi/dhcpd.leases";
ddns-updates off;
default-lease-time 60;
option subnet-mask 255.255.255.192;
subnet 10.250.0.0 netmask 255.255.255.192 {
  range dynamic-bootp 10.250.0.11 10.250.0.42;
  next-server 10.250.0.10;
  filename "pxelinux.0";
}

We’re almost done! Connect your machines to each other, switch off all firewalls and other stuff that might block the network, best you switch off networkmanager (“service network stop”) and set your network settings manually with the ip tool:


ip link set eth0 up
ip addr set 10.250.0.10/26 dev eth0
touch /tmp/kiwi/dhcpd.leases
chmod -R a+rX /tmp/kiwi
dhcpd -4 -cf /tmp/kiwi/dhcpd.conf eth0
atftpd --daemon --no-multicast --bind-address 10.250.0.10
nbd-server 10.250.0.10:4024 /tmp/kiwi/pxe-dest/*.clicfs -r -l /tmp/kiwi/nbd.allow -p /tmp/kiwi/nbd.pid

…and try booting the client.

Addendum: This bug breaks the clicfs images when it’s served by nbd-server. You will have to pad it with zeros so that its size is a multiple of 1KiB (or better 4KiB).