Kodi Community Forum
[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)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17


- opdenkamp - 2010-11-15

just backing up xbmc.img is one of the nice things indeed Smile
the image won't be overwritten until you call "install" by the way.

about the locales: chroot into the target and install language-pack-de or add that to the extra packages when creating a new installation. haven't checked if the name is 100% correct, so if it's not, apt-cache search for language-pack and select the one you need.

btw: if you know how to read bash scripts, open up /usr/sbin/xbmc-diskless.sh and have a look. no rocket science in there and it will make the process a lot clearer to you. it's just a script that I created to fasten up the actions I had to do to create a new diskless installation which I did manually before (cause once you created an image, the only thing you'll ever do is update it and create a new squashfs image). I never did much with bash scripts tbh, so if someone knows bash, you're free to improve/clean up the code Smile


- castlec - 2010-11-23

So I've already got pxe boot set up with the mythbuntu-diskless-server package. I'd like to give xbmc and its myth plugin a shot to see if I like it better. Does anyone foresee any issues with just doing a standard install on top of my current image? It doesn't look like I need the xbmc-diskless package at all. I would just need to build an appropriate image, if anything; right? Are there PPAs for 10.10?

Thanks all!


- opdenkamp - 2010-11-23

I'm using the same tcp port for the nbd mounted image (port 2000), so only one of them can be active at any time or you'll have to use another port number. Only port 2000 works for xbmc-diskless at the moment, so you'll have to do that in the mythbuntu config.

The rest should not interfere with mythbuntu-diskless.

You have two choices:
- use your mythbuntu installation and just install xbmc in it's image
- install xbcm-diskless-server and create a new image for xbmc

The first option is the easiest if you're not familiar with this, but it will be slower and probably won't boot anymore after a power failure or some os crash.


- castlec - 2010-11-23

dushmaniac Wrote:I'm using the same tcp port for the nbd mounted image (port 2000), so only one of them can be active at any time or you'll have to use another port number. Only port 2000 works for xbmc-diskless at the moment, so you'll have to do that in the mythbuntu config.

Not exactly sure what I'd need to do here. Would you be able to elaborate?


dushmaniac Wrote:The first option is the easiest if you're not familiar with this, but it will be slower and probably won't boot anymore after a power failure or some os crash.

Why slower?

dushmaniac Wrote:- install xbcm-diskless-server and create a new image for xbmc

can I just use an
Code:
ltsp-build-client
with a root xbmc package to use my existing infrastructure?

Thanks a lot for your help.


- opdenkamp - 2010-11-23

castlec Wrote:Not exactly sure what I'd need to do here. Would you be able to elaborate?
mythbuntu-diskless-server uses a squashfs image mounted using nbd. the default tcp port used by mythbuntu-diskless is 2000. I'm using the same port number for the image for xbmc-diskless and you can only serve 1 block device on a port.

it's configured in /etc/inetd.conf, so you'll have to change it there after using the "install" option in the xbmc-diskless menu (assuming you followed the howto on page 1)

Quote:Why slower?
explained it on the previous page. to put it simple: I'm not using nfs for things that don't have to be persisted in xbmc-diskless and nfs is used differently in general. There are also a couple of differences in the init scripts, making it boot and shutdown a lot faster.

Quote:can I just use an
Code:
ltsp-build-client
with a root xbmc package to use my existing infrastructure?
you could just install xbmc on a ltsp image. then you'll just have a normal ubuntu installation (but booted over the network) with xbmc on it. the xbmc-diskless images won't boot a full ubuntu installation but will just boot the basic things that are needed and xbmc (so no window manager etc.)

edit:
if you're going to install it on your ltsp image, don't try to install "xbmc-diskless-client" but install "xbmc" or it'll fail the preinstall checks, saying that you can't install the package on a non-diskless installation


- arionl - 2010-11-28

dushmaniac,

Today I decided to update the XBMC inside of my diskless chroot. I used the commands you listed earlier to properly enter the diskless root target at "/var/lib/xbmc-diskless/target" and then did an "aptitude update; aptitude safe-upgrade". When it got to upgrading "xbmc-diskless-client" I received an error saying " This package is only meant to be installed inside a XBMC diskless chroot." Should I force this package to install? Any suggestions?

Thanks!
Arion


- opdenkamp - 2010-11-28

it's a safeguard so that you don't make a non-diskless installation unbootable.

inside your chroot, do this and run the update process again:
Code:
touch /tmp/.xbmc
that'll suppress the warning.

you can also just choose "upgrade" in the xbmc-diskless menu.


- arionl - 2010-11-29

Thanks for the info. I was inside of the chroot doing some other tweaks and figured I'd do the package update there rather than using the menu selection. Thanks for pointing out how to place a trigger for successful package installation.

Btw, you mentioned that you would be working on integrating shared library support in your xbmc-diskless scripts. I was able to set up an SQL server for my diskless clients and configure them via advancedsettings.xml and it seems to be working good so far. The only other challenge I faced was providing a shared directory for the clients to all have access to a shared Thumbnails/images directory (normally found at "~/.xbmc/userdata/Thumbnails"). Here's what I did:

1) created a directory called "/var/lib/xbmc-diskless/overlay/library" and shared it out via NFS from the server
2) added a "/etc/fstab" NFS mount entry inside the target so the clients could mount the directory. To make things simple, I have this shared directory mounted as "/mnt" in the diskless clients
3) created a symlink inside each diskless client's userdata directory to point "Thumbnails" to /mnt.
4) added a "mount /mnt" to /etc/rc.local, since I had problems with normal NFS mount flags getting clients to automount the share, even when it was marked as mount-on-boot.

Does this seem reasonable or similar to an approach you've used? I know its kinda convoluted, but it seems to be working for now...

Take care,
Arion


- opdenkamp - 2010-11-29

Quote:Btw, you mentioned that you would be working on integrating shared library support in your xbmc-diskless scripts.
yeah that one's still on my todo list Smile

Quote:2) added a "/etc/fstab" NFS mount entry inside the target so the clients could mount the directory. To make things simple, I have this shared directory mounted as "/mnt" in the diskless clients
3) created a symlink inside each diskless client's userdata directory to point "Thumbnails" to /mnt.
why not just mount ~/.xbmc/userdata/Thumbnails directly?

Quote:4) added a "mount /mnt" to /etc/rc.local, since I had problems with normal NFS mount flags getting clients to automount the share, even when it was marked as mount-on-boot.
I currently have it mounted by an rc script too, because I'm checking if the Thumbnails folder doesn't exist yet, etc.

Quote:Does this seem reasonable or similar to an approach you've used? I know its kinda convoluted, but it seems to be working for now...
I'll see if I have enough time to update the script somewhere this week.


- arionl - 2010-11-30

dushmaniac Wrote:yeah that one's still on my todo list Smile
why not just mount ~/.xbmc/userdata/Thumbnails directly?
I currently have it mounted by an rc script too, because I'm checking if the Thumbnails folder doesn't exist yet, etc.
I'll see if I have enough time to update the script somewhere this week.

Yeah I suppose I should really mount it directly but for now I'm still manually tweaking each of my diskless clients (I only have two of them). I figured it was easier to let the clients create a skeleton "~/.xbmc" directory on first boot and then go to the server and add any client-specific customizations (including sources, advancedsettings, Thumbnails symlink). I guess there really isn't any reason I can't automate this and it would be a lot cleaner, but for now, with my two clients, its working ok Smile

BTW, I had to update the NVidia drivers and ALSA in my XBMC target image to get HDMI audio working because one of my diskless clients is a Gen2 ION system (Zotac ZBOX HD-ID11-U). It took a bit of trial and error, but I was able to get everything working eventually using various Ubuntu PPAs.

Thanks again for your work on the diskless package. Its so much nicer to have a server-based solution for my media boxes than maintaining them separately before.

Take care,
Arion


- opdenkamp - 2010-12-01

Once you have it set up correctly, you should use the provisioning mechanism described on the first page.

I got the stuff like advancedsettings, a little mount script for thumbnails, etc. included in the "default.tar.bz2" package because it's common to all clients. The only things that I put in client specific packages are config files for the remotes and sound cards.

That way you can fool around with your clients as much as you like and you'll only have to reboot it and remove the overlay directory for that client to completely reset it.


- JohnPollaert - 2010-12-08

I'm using Fedora 12 on my server. Any chance this would be working on Fedora? The instructions are for Ubuntu/Debian.


- opdenkamp - 2010-12-09

It's made for Ubuntu, but you can get it working on other distros (if you're an experienced linux user). The only thing that's ubuntu/debian software is debootstrap, so you'll have to get that working if you want to build images on your fedora machine.

What I recommend is creating an image on some ubuntu machine and copying it over to your server.

I really can't provide instructions for every possible os, but if you're an experienced linux user, you should be able to get it up and running after configuring the following services correctly:
- nfs
- tftp
- dhcp + nextserver directive
- nbdrootd

the configurations can be found in the xbmc-diskless.sh script.


- stryker - 2010-12-13

hi all and dushmaniac

Are you planning a new version of this? perhaps with the central DB?

Regards,

Jon


- opdenkamp - 2010-12-13

yes, it's planned for the christmas holiday but after I finished my janitor work on the pvr branch.