[LINUX] HOW-TO create a XBMC server for diskless PXE network booting clients - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: Tips, tricks, and step by step guides (https://forum.kodi.tv/forumdisplay.php?fid=110) +--- Thread: [LINUX] HOW-TO create a XBMC server for diskless PXE network booting clients (/showthread.php?tid=83840) |
[LINUX] HOW-TO create an XBMC server for diskless PXE network booting clients - opdenkamp - 2010-10-23 What does this package do? The xbmc-diskless-server package installs the server software that is needed to let any PC boot from the network and start XBMC on that PC, the same as XBMC live. It works by creating an image of an Ubuntu installation with XBMC on a server and having your clients boot that (read only) image. The client's configuration and media databases are stored via NFS, so they won't be lost when you reboot your client. This brings us some nice advantages:
Installation If you want a diskless XBMC installation, you'll need a server to host it's files. On that server, you'll install the 'xbmc-diskless-server' package. It contains some scripts to create a disk image for your clients and it makes sure the required server components get installed and update the configuration. Follow these steps to install the server software.
Create an image
... continued in the next post - opdenkamp - 2010-10-23 Create an image (2) [LIST=6] [*]verify the data you entered in the final screen. if you made any mistake, press 'no' and start the wizard again: [*]pressing 'yes' will start the installation process. this will take a couple of minutes, depending on the speed of your internet connection and server: [*]if everything went well, you'll see the following screen. Proceed to the next paragraph: [/LIST] Pack an image
... continued in the next post - opdenkamp - 2010-10-23 Install a new image
Adding your server to the DHCP options of the clients You only have to do this once. Your clients have to know where to find the files it needs to boot. This is done by adding it to the DHCP of the clients. If you are using ISC dhcp, the default dhcp server on Ubuntu, add these lines to your host's configuration lines: Code: next-server XXX.XXX.XXX.XXX; Example: Code: subnet 192.168.64.0 netmask 255.255.192.0 { Restart your dhcp server to make the new configuration active: Code: sudo /etc/init.d/dhcp3-server restart On your clients, enable "boot from LAN" in the BIOS. Check your motherboard's or network card's manual on how to do that. Provisioning (optional) You might want to distribute some files to one or more clients without adding them to the image. Think about your video database, lirc config files, etc. That's what the provisioning mechanism is for. In the directory /var/lib/xbmc-diskless/provsion you can create a directory 'default' with files you want to have copied to all clients on the first boot. Those files will be copied to the client's /home/xbmc directory on the first start of each client. You can also add directories for each separate client by creating a directory with the mac address of the client as name (without the colons). Please make sure you have the permissions set correctly: chown 1000:1000 to each of the files. /etc is symlinked to /home/xbmc/config so you can add files there too. To update the provisioning package, start the xbmc-diskless.sh GUI and choose "provision" Upgrading (optional) If you created an image before, you can upgrade it without creating a new image. Choose "upgrade" from the menu to run "sudo apt-get -f dist-upgrade" on the target. If for some reason the update failed, you can manually fix it by running these commands (this will be simplified in the next version): Code: sudo mount -o bind /dev /var/lib/xbmc-diskless/target/dev Extras (optional) There are a few more options available by editing the configuration files. Check the readme file in /usr/share/doc/xbmc-diskless-server, or choose 'help' in the GUI. Checklist
If anything went wrong, go back to the first post and verify each step. If it still doesn't work, report it here. Source The latest sources can be found at http://github.com/opdenkamp/xbmc-diskless Disclaimer Not every advanced option from the config file is working correctly at the moment, because this is still in beta stage. e.g. the option for the nbd server port that is used is not read and port 2000 is always used. All the functions described here are working fine and have been tested using various setups, but all of them are using nvidia video cards. I haven't tested any others since I don't have any. I have a lot of things that I want to add later. Think about a centralised user database, the ability distribute one client's config to others, wake on lan for clients, resetting a clients config from the GUI, etc. Since this version is usable and tested already (I'm using this system for months on all my clients now), I didn't want to wait till all those features are added before releasing it. Be sure to check for updates regularly! If you're having trouble, be sure to check the log file /var/log/xbmc-diskless.log for information about what went wrong. If you need more help, post your question here or ask me on irc. This software is based on mythbuntu-diskless-server, which is based on ltsp-client-core. Their copyright notices can be found in /usr/share/doc/xbmc-diskless-server This howto is updated for xbmc-diskless v0.4.9.1 - opdenkamp - 2010-10-23 <reserved> - vikjon0 - 2010-10-23 Interesting! I was actually looking into installing xbmcLive over PXE this very day. It is proving a bit too hard for me, I think I need to build a netboot initrd and perhaps rearrange the installer. I spent a loot of time on the pxe server though and I got it working with dnsmasq proxydhcp. You might want to add proxydhcp to your server, I assume many of your potential users have a cheap router with dhcp not a linux dhcp. I would offer to help, but by the look of it you are a bit more advanced than me and probably dont need it. - opdenkamp - 2010-10-23 I'm not doing anything with dhcp in my scripts, just describing what you have to do to set it up in this howto. I don't know proxydhcp, so if you can tell me how to add a "next-server" and "filename" directive to that one, I'm happy to add it to this howto. My "potential users" will need some linux machine to host the image and client specific files and the scripts focus on that machine. If you're running dhcp on a different machine, you'll have to edit it's configuration manually. - vikjon0 - 2010-10-23 The reason I went with a proxy is that I use dhcp on the router which does not support pxe. I don't want a server running all the time to have dhcp for the laptops. I guess since your setup require a permenent server it is a bit differrent. Still, assuming you want to turn off it sometimes it could still be usefull. (I also predict you will get a lot support issues on dhcp that will be avoided if you include a proxy) I posted my notes here: http://vikjonlinuxhowto.blogspot.com/2010/10/dchpproxy.html It is working as is but I intend to clean it up. - opdenkamp - 2010-10-23 vikjon0 Wrote:The reason I went with a proxy is that I use dhcp on the router which does not support pxe. I don't want a server running all the time to have dhcp for the laptops.I'll look into that tonight or tomorrow and will come back on that. Thanks for the pointer - opdenkamp - 2010-10-24 That proxydhcp looks good. I'll run some tests later today and if it works correctly I'll include it in the next release. - opdenkamp - 2010-10-26 Little update: amd64 package fixed. new packages are uploaded and will be published within 30 minutes. - vikjon0 - 2010-10-27 if you decide to include it, I have now created a auto config of dnsmasq (well, stole most of the code of course) http://ubuntuforums.org/showpost.php?p=10032817&postcount=3 Needs run on start as root..not sure how to do that. - opdenkamp - 2010-10-27 I'll look into it before the next release. thanks for the info - Anastrophe - 2010-10-27 Amazing stuff, thanks so much for working on this! - Anastrophe - 2010-10-28 are there any log files to check as I get to 25% of compressing image and it stays there for >24hrs? no PPA selected if that helps - opdenkamp - 2010-10-28 you can check a log of the installation in /var/log/xbmc-diskless.log for a complete installation log. the "mksquashfs" itself isn't logged. if you want to see what the compression does, execute this: Code: rm -f /var/lib/xbmc-diskless/images/xbmc.img-new |