[LINUX] HOW-TO create a XBMC server for diskless PXE network booting clients

  Thread Rating:
  • 2 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Anastrophe Offline
Donor
Posts: 259
Joined: Mar 2004
Reputation: 0
Location: Dubai, UAE
Post: #16
strange, it get to about 2% and then has hundreds on no file found errors. When I run the script again and choose official PPA it takes me straight back to the main menu, the PVR PPA seems to work though (spoke too soon as after entering additional pacakes and xbmc password screen it downloads something for about 10secs and then bck to main screen again)

The log contains lots of permission errors:
Quote:/bin/rm: cannot remove `/var/lib/xbmc-diskless/target/sys/module/usb_storage/sections/.bss': Operation not permitted
/bin/rm: cannot remove `/var/lib/xbmc-diskless/target/sys/module/usb_storage/sections/.symtab': Operation not permitted
/bin/rm: cannot remove `/var/lib/xbmc-diskless/target/sys/module/usb_storage/sections/.strtab': Operation not permitted
/bin/rm: cannot remove `/var/lib/xbmc-diskless/target/sys/module/usb_storage/notes/.note.gnu.build-id': Operation not permitted
/bin/rm: cannot remove `/var/lib/xbmc-diskless/target/sys/module/usb_storage/drivers/usb:usb-storage': Operation not permitted
/bin/rm: cannot remove directory `/var/lib/xbmc-diskless/target/sys/module/jfs/holders': Operation not permitted
/bin/rm: cannot remove `/var/lib/xbmc-diskless/target/sys/module/jfs/srcversion': Operation not permitted
/bin/rm: cannot remove `/var/lib/xbmc-diskless/target/sys/module/jfs/initstate': Operation not permitted
/bin/rm: cannot remove `/var/lib/xbmc-diskless/target/sys/module/jfs/refcnt': Operation not permitted
/bin/rm: cannot remove `/var/lib/xbmc-diskless/target/sys/module/jfs/sections/.note.gnu.build-id': Operation not permitted
/bin/rm: cannot remove `/var/lib/xbmc-diskless/target/sys/module/jfs/sections/.text': Operation not permitted
/bin/rm: cannot remove `/var/lib/xbmc-diskless/target/sys/module/jfs/sections/.exit.text': Operation not permitted
/bin/rm: cannot remove `/var/lib/xbmc-diskless/target/sys/module/jfs/sections/.altinstr_replacement': Operation not permitted
/bin/rm: cannot remove `/var/lib/xbmc-diskless/target/sys/module/jfs/sections/.init.text': Operation not permitted
/bin/rm: cannot remove `/var/lib/xbmc-diskless/target/sys/module/jfs/sections/.rodata': Operation not permitted
/bin/rm: cannot remove `/var/lib/xbmc-diskless/target/sys/module/jfs/sections/.altinstructions': Operation not permitted
/bin/rm: cannot remove `/var/lib/xbmc-diskless/target/sys/module/jfs/sections/.rodata.str1.1': Operation not permitted
/bin/rm: cannot remove `/var/lib/xbmc-diskless/target/sys/module/jfs/sections/.rodata.str1.4': Operation not permitted
/bin/rm: cannot remove `/var/lib/xbmc-diskless/target/sys/module/jfs/sections/.smp_locks': Operation not permitted
/bin/rm: cannot remove `/var/lib/xbmc-diskless/target/sys/module/jfs/sections/.parainstructions': Operation not permitted
/bin/rm: cannot remove `/var/lib/xbmc-diskless/target/sys/module/jfs/sections/__bug_table': Operation not permitted
/bin/rm: cannot remove `/var/lib/xbmc-diskless/target/sys/module/jfs/sections/__param': Operation not permitted
/bin/rm: cannot remove `/var/lib/xbmc-diskless/target/sys/module/jfs/sections/__mcount_loc': Operation not permitted
/bin/rm: cannot remove `/var/lib/xbmc-diskless/target/sys/module/jfs/sections/.data': Operation not permitted
(This post was last modified: 2010-10-28 19:10 by Anastrophe.)
find quote
opdenkamp Offline
Team-XBMC PVR Developer
Posts: 2,221
Joined: Feb 2009
Reputation: 29
Location: Heerlen, The Netherlands
Post: #17
hmm strange, I'll look into that. think the process aborted somewhere while running and didn't umount properly.

could you pastebin the log up till the errors please?

before trying again, do this:
Code:
sudo umount /var/lib/xbmc-diskless/target/sys
sudo umount /var/lib/xbmc-diskless/target/proc
sudo umount /var/lib/xbmc-diskless/target/dev
sudo rm -rf /var/lib/xbmc-diskless/target

thanks for reporting this issue.

opdenkamp / dushmaniac

xbmc-pvr [Eden-PVR builds] [now included in mainline XBMC, so no more source link here :)]
personal website: [link]

Found a problem with PVR? Report it on Trac, under "PVR - core components". Please attach the full debug log.

If you like my work, please consider donating to me and/or Team XBMC.
(This post was last modified: 2010-10-28 23:38 by opdenkamp.)
find quote
opdenkamp Offline
Team-XBMC PVR Developer
Posts: 2,221
Joined: Feb 2009
Reputation: 29
Location: Heerlen, The Netherlands
Post: #18
found a bug that prevents /target/dev from umounting sometimes. I'll add some more checks in the next version.

opdenkamp / dushmaniac

xbmc-pvr [Eden-PVR builds] [now included in mainline XBMC, so no more source link here :)]
personal website: [link]

Found a problem with PVR? Report it on Trac, under "PVR - core components". Please attach the full debug log.

If you like my work, please consider donating to me and/or Team XBMC.
find quote
opdenkamp Offline
Team-XBMC PVR Developer
Posts: 2,221
Joined: Feb 2009
Reputation: 29
Location: Heerlen, The Netherlands
Post: #19
a new version has been published

fixes:
  • added some more checks
  • improved error handling
  • improved logging
  • the "installation gauge" is more precise now
  • fixed mount checks
  • limit rm with --one-filesystem so /dev can't be removed accidently
  • some cleanups

opdenkamp / dushmaniac

xbmc-pvr [Eden-PVR builds] [now included in mainline XBMC, so no more source link here :)]
personal website: [link]

Found a problem with PVR? Report it on Trac, under "PVR - core components". Please attach the full debug log.

If you like my work, please consider donating to me and/or Team XBMC.
find quote
opdenkamp Offline
Team-XBMC PVR Developer
Posts: 2,221
Joined: Feb 2009
Reputation: 29
Location: Heerlen, The Netherlands
Post: #20
@Anastrophe:
please try again with this package and pastebin the log if it still fails.

opdenkamp / dushmaniac

xbmc-pvr [Eden-PVR builds] [now included in mainline XBMC, so no more source link here :)]
personal website: [link]

Found a problem with PVR? Report it on Trac, under "PVR - core components". Please attach the full debug log.

If you like my work, please consider donating to me and/or Team XBMC.
find quote
harryzimm Offline
Posting Freak
Posts: 852
Joined: May 2008
Reputation: 6
Location: Auchtermuchty, Scotland
Post: #21
This is great. Thanks for sharing Smile

Im going to give it a go tonight. I'll let you know how i get on.

cheers

HTPC 1 : Acer revo R3700 ion2 HTPC 2 :Apple TV2 HTPC 3 : Apple TV2 HTPC4 Acer revo R3700 ion2 Remote : x2 Riimote2
SERVER : 10TB Ubuntu Server 10.04, dual wintv nova hd s2 cards, tvheadend, Newcs, Omnikey reader, White *Sky uk* Card, Mysql Db, Sabnzbdplus, SickBeard, Couchpotato, FlexRaid. :cool:
--------------------------------------------
[Image: widget]
find quote
opdenkamp Offline
Team-XBMC PVR Developer
Posts: 2,221
Joined: Feb 2009
Reputation: 29
Location: Heerlen, The Netherlands
Post: #22
Little bug: the provisioning files are going to the wrong directory (/var/lib/xbmc-diskless/overlay instead of /var/lib/xbmc-diskless/overlay/provision).

bugfix build will be online within an hour

opdenkamp / dushmaniac

xbmc-pvr [Eden-PVR builds] [now included in mainline XBMC, so no more source link here :)]
personal website: [link]

Found a problem with PVR? Report it on Trac, under "PVR - core components". Please attach the full debug log.

If you like my work, please consider donating to me and/or Team XBMC.
find quote
mason Offline
Senior Member
Posts: 295
Joined: Sep 2008
Reputation: 0
Location: Germany
Post: #23
Awesome idea and thanks for your work to say first, i tried to get this up and running but I'm no advanced linux user. I set up the whole thing on my lucid server with the dnsmasq script posted here, the clients recognize the server but times out it seems, the daemon.log shows me this

Code:
Nov  7 21:49:43 GATE dnsmasq-dhcp[3370]: 791112278 Available DHCP subnet: 192.168.1.147/255.255.255.0
Nov  7 21:49:43 GATE dnsmasq-dhcp[3370]: 791112278 Vendor class: PXEClient:Arch:00000:UNDI:002001
Nov  7 21:49:43 GATE dnsmasq-dhcp[3370]: 791112278 PXE(eth0) 00:01:2e:27:6a:56 proxy
Nov  7 21:49:43 GATE dnsmasq-dhcp[3370]: 791112278 tags: eth0
Nov  7 21:49:43 GATE dnsmasq-dhcp[3370]: 791112278 bootfile name: /var/lib/tftpboot/pxelinux.0
Nov  7 21:49:43 GATE dnsmasq-dhcp[3370]: 791112278 sent size:  1 option: 53:message-type  02
Nov  7 21:49:43 GATE dnsmasq-dhcp[3370]: 791112278 sent size:  4 option: 54:server-identifier  192.168.1.147
Nov  7 21:49:43 GATE dnsmasq-dhcp[3370]: 791112278 sent size:  9 option: 60:vendor-class  50:58:45:43:6c:69:65:6e:74
Nov  7 21:49:43 GATE dnsmasq-dhcp[3370]: 791112278 sent size: 17 option: 97:client-machine-id  00:00:02:00:03:00:04:00:05:00:06:00:07...
Nov  7 21:49:43 GATE dnsmasq-dhcp[3370]: 791112278 sent size: 75 option: 43:vendor-encap  06:01:03:08:07:80:00:01:c0:a8:01:93:09...
Nov  7 21:49:48 GATE dnsmasq-dhcp[3370]: 791112278 Available DHCP subnet: 192.168.1.147/255.255.255.0
Nov  7 21:49:48 GATE dnsmasq-dhcp[3370]: 791112278 Vendor class: PXEClient:Arch:00000:UNDI:002001
Nov  7 21:49:48 GATE dnsmasq-dhcp[3370]: 791112278 Available DHCP subnet: 192.168.1.147/255.255.255.0
Nov  7 21:49:48 GATE dnsmasq-dhcp[3370]: 791112278 Vendor class: PXEClient:Arch:00000:UNDI:002001
Nov  7 21:49:48 GATE dnsmasq-dhcp[3370]: 791112278 PXE(eth0) 192.168.1.36 00:01:2e:27:6a:56 pxelinux.0
Nov  7 21:49:48 GATE dnsmasq-dhcp[3370]: 791112278 tags: eth0
Nov  7 21:49:48 GATE dnsmasq-dhcp[3370]: 791112278 bootfile name: pxelinux.0
Nov  7 21:49:48 GATE dnsmasq-dhcp[3370]: 791112278 next server: 192.168.1.147
Nov  7 21:49:48 GATE dnsmasq-dhcp[3370]: 791112278 sent size:  1 option: 53:message-type  05
Nov  7 21:49:48 GATE dnsmasq-dhcp[3370]: 791112278 sent size:  4 option: 54:server-identifier  192.168.1.147
Nov  7 21:49:48 GATE dnsmasq-dhcp[3370]: 791112278 sent size:  9 option: 60:vendor-class  50:58:45:43:6c:69:65:6e:74
Nov  7 21:49:48 GATE dnsmasq-dhcp[3370]: 791112278 sent size: 17 option: 97:client-machine-id  00:00:02:00:03:00:04:00:05:00:06:00:07...
Nov  7 21:49:48 GATE dnsmasq-dhcp[3370]: 791112278 sent size: 35 option: 43:vendor-encap  47:04:80:00:00:00:0a:17:00:50:72:65:73...
Nov  7 21:49:50 GATE in.tftpd[3853]: tftp: client does not accept options
Nov  7 21:50:06 GATE dnsmasq-dhcp[3370]: 3781095517 Available DHCP subnet: 192.168.1.147/255.255.255.0
Nov  7 21:50:06 GATE dnsmasq-dhcp[3370]: 3781095517 Vendor class: udhcp 0.9.9-pre
Nov  7 21:50:06 GATE dnsmasq-dhcp[3370]: 3781095517 Available DHCP subnet: 192.168.1.147/255.255.255.0
Nov  7 21:50:06 GATE dnsmasq-dhcp[3370]: 3781095517 Vendor class: udhcp 0.9.9-pre

I guess i have to adjust some permissions to the tftpd? Can someone point me in the right direction?

I removed the quiet and splash from the /var/lib/tftpboot/pxelinux.0
to see whats going on, it looks like its start loading the kernel and get's a 'connection refused on ndb mount' maybe this helps a little more debuging this.
(This post was last modified: 2010-11-07 23:13 by mason.)
find quote
vikjon0 Offline
---
Posts: 2,502
Joined: Apr 2009
Reputation: 8
Location: Sweden
Post: #24
Quote:the clients recognize the server but times out it seems, the daemon.log

Not sure what the problem is or if there are any specific requirements in this setup.
Generally I have noticed that dnsmasq is a bit sensitive how the menu is setup:
Quote:pxe-service=X86PC, "Boot from network", pxelinux
etc.

If you edited that, start over with the sample.

more info:
http://ubuntuforums.org/showthread.php?t=1606910
find quote
mason Offline
Senior Member
Posts: 295
Joined: Sep 2008
Reputation: 0
Location: Germany
Post: #25
I guess I'm a step further, It's stopping with a 'connection refused' when the nbd is trying to mount the root fs....
find quote
opdenkamp Offline
Team-XBMC PVR Developer
Posts: 2,221
Joined: Feb 2009
Reputation: 29
Location: Heerlen, The Netherlands
Post: #26
what does "xbmc-diskless.sh check" say?

opdenkamp / dushmaniac

xbmc-pvr [Eden-PVR builds] [now included in mainline XBMC, so no more source link here :)]
personal website: [link]

Found a problem with PVR? Report it on Trac, under "PVR - core components". Please attach the full debug log.

If you like my work, please consider donating to me and/or Team XBMC.
find quote
mason Offline
Senior Member
Posts: 295
Joined: Sep 2008
Reputation: 0
Location: Germany
Post: #27
everything looks good


xbmc-diskless.sh check
Loading the default configuration
Checking your configuration:
image present: yes
inetd running: yes
tftpd running: yes
tftpd (69) listening: yes
nfsd running: yes
mountd running: yes
statd running: yes
portmap running: yes
/etc/exports has overlay: yes
portmap (111) listening: yes
nfs (2049) listening: yes

I tried telneting into port 2000 from the nbd... working

Oh wait, just noticed somehow it tries to connect to 192.168.1.1 which is my router, i guess this have something to do with the dnsmasq... I'll see if I could add the host somehow to the config !?
(This post was last modified: 2010-11-08 00:01 by mason.)
find quote
opdenkamp Offline
Team-XBMC PVR Developer
Posts: 2,221
Joined: Feb 2009
Reputation: 29
Location: Heerlen, The Netherlands
Post: #28
this is also wrong:
Code:
Nov  7 21:49:43 GATE dnsmasq-dhcp[3370]: 791112278 bootfile name: /var/lib/tftpboot/pxelinux.0
by default, xbmc-diskless pxe boot files are installed in /var/lib/tftpboot/xbmc-netboot. you're probably serving the wrong file. you should change that in the dnsmasq config too.

edit:
nvm that, they're not installed there anymore. I removed that from the global config a while ago Smile

opdenkamp / dushmaniac

xbmc-pvr [Eden-PVR builds] [now included in mainline XBMC, so no more source link here :)]
personal website: [link]

Found a problem with PVR? Report it on Trac, under "PVR - core components". Please attach the full debug log.

If you like my work, please consider donating to me and/or Team XBMC.
find quote
mason Offline
Senior Member
Posts: 295
Joined: Sep 2008
Reputation: 0
Location: Germany
Post: #29
I guess i wouldn't be able to boot anything if the pxelinux.0 file wasn't found.

I don't get it...

eth0 configured at 192.168.1.136:192.168.1.1:192.168.1.1:255.255.255.0:
Done.
Begin: Mounting root file system...
Begin: Running /scripts/nfs-top ...
Done.
Begin: mounting the NDB root ...
Error: Connect: Connection refused
find quote
opdenkamp Offline
Team-XBMC PVR Developer
Posts: 2,221
Joined: Feb 2009
Reputation: 29
Location: Heerlen, The Netherlands
Post: #30
I'll make it a bit more verbose, let it tell where it's connecting to.

try this in the meantime and see if you can connect:
add "break=Xnbd" to the kernel parameters and reboot your diskless box.
it'll break the booting process just before mounting the nbd root

type this in the console:
Code:
mkdir /rofs
nbd-client xxx.xxx.xxx.xxx 2000 /dev/nbd0
mount -o ro -t squashfs /dev/nbd0 /rofs
replace xxx.xxx.xxx.xxx by the ip of your server.

if that works, see if you can ls /rofs and if your root shows up.

opdenkamp / dushmaniac

xbmc-pvr [Eden-PVR builds] [now included in mainline XBMC, so no more source link here :)]
personal website: [link]

Found a problem with PVR? Report it on Trac, under "PVR - core components". Please attach the full debug log.

If you like my work, please consider donating to me and/or Team XBMC.
find quote
Post Reply