WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: PXE boot and rdesktop autostart  (Read 11020 times)

Offline achduschande

  • Newbie
  • *
  • Posts: 5
PXE boot and rdesktop autostart
« on: October 22, 2010, 11:54:45 AM »
Hello,

I'm trying to remaster TC in order to get a version that starts via PXE and automatically starts rdesktop. It has to run on a 32MB-client (HP compaq t5000) which we're using in school.
Here's what I did:
* setting up an TC-PXE-Server with tinycore.gz and bzImage in /netboot
* remastering TC with ezremaster including rdesktop
Here's what happens:
When choosing "inside initrd" the client starts, but then throws some error messages and hangs... (I don't know how to read the messages afterwards since it goes so fast...)
When choosing "Extract into TCZ" the client starts and stop with an error message: "sudo command not found" (or something like that)

I guess it's because of the limited client memory (starting from a client with more memory works well...) - maybe someone can tell me how to include rdesktop in a memory-saving way... It must be possible, because starting via USB-stick works.

Thank you very much!






Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: PXE boot and rdesktop autostart
« Reply #1 on: October 22, 2010, 11:58:57 AM »
Read the netboot section in the wiki.  You should not need to remaster.

Offline achduschande

  • Newbie
  • *
  • Posts: 5
Re: PXE boot and rdesktop autostart
« Reply #2 on: October 22, 2010, 12:14:03 PM »
Read the netboot section in the wiki.  You should not need to remaster.

...that's what I did - do you mean the "PXE and PPR/TCZ on an NFS share"-part? I didn't really understand it all...

While adjusting the available memory in VirtualBox I found out that booting with 60 MB RAM works well while booting with 56 MB (that's the mem of the client - not 32MB) throws errors...

So I need 4 MB more RAM...

Offline gutmensch

  • Administrator
  • Hero Member
  • *****
  • Posts: 605
  • I can make it disappear, have no fear!
    • remembrance blog
Re: PXE boot and rdesktop autostart
« Reply #3 on: October 22, 2010, 12:52:34 PM »
It shouldn't be that hard to get additional 4 MB of ram if you remaster already. for example list all modules you use on the client with lsmod and then delete the others, which are not needed from /lib/modules, when you remaster. You can remove aterm, wbar, zsync, etc. as well since they're not needed for your purpose. Even flwm stuff is not needed (I think maro made some DESKTOP variable hack and just used Xvesa with rdesktop without any window manager). Finally you can try to use tinycore 2.x - I managed to run it on a Wyse Thin Client, which has very few RAM too ;-)
If I seem unduly clear to you, you must have misunderstood what I said. (Alan Greenspan)

Offline ixbrian

  • Administrator
  • Sr. Member
  • *****
  • Posts: 436
Re: PXE boot and rdesktop autostart
« Reply #4 on: October 22, 2010, 07:06:25 PM »
Hello,

I'm trying to remaster TC in order to get a version that starts via PXE and automatically starts rdesktop. It has to run on a 32MB-client (HP compaq t5000) which we're using in school.
Here's what I did:
* setting up an TC-PXE-Server with tinycore.gz and bzImage in /netboot
* remastering TC with ezremaster including rdesktop
Here's what happens:
When choosing "inside initrd" the client starts, but then throws some error messages and hangs... (I don't know how to read the messages afterwards since it goes so fast...)
When choosing "Extract into TCZ" the client starts and stop with an error message: "sudo command not found" (or something like that)

I guess it's because of the limited client memory (starting from a client with more memory works well...) - maybe someone can tell me how to include rdesktop in a memory-saving way... It must be possible, because starting via USB-stick works.

Thank you very much!

Booting from USB works because your extensions probably are not being loaded in RAM (they are just mounted from USB), so it requires less memory that remastering everything into tinycore.gz which causes everything to be loaded in to RAM. 

With ezremaster, using "inside initrd" will take less memory than "extract into TCZ".  Also, you might want to try using the "embed" boot code, this reduces the amount of memory needed at boot time. 

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: PXE boot and rdesktop autostart
« Reply #5 on: October 22, 2010, 08:13:44 PM »
See also this thread about constraints on memory:
http://forum.tinycorelinux.net/index.php?topic=6984.0
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline achduschande

  • Newbie
  • *
  • Posts: 5
Re: PXE boot and rdesktop autostart
« Reply #6 on: October 23, 2010, 01:06:24 AM »
It shouldn't be that hard to get additional 4 MB of ram if you remaster already. for example list all modules you use on the client with lsmod and then delete the others, which are not needed from /lib/modules, when you remaster. You can remove aterm, wbar, zsync, etc. as well since they're not needed for your purpose. Even flwm stuff is not needed (I think maro made some DESKTOP variable hack and just used Xvesa with rdesktop without any window manager). Finally you can try to use tinycore 2.x - I managed to run it on a Wyse Thin Client, which has very few RAM too ;-)

Hi,

I understood that, it seems to offer a great solution for my problem. I know how to remaster, but as I'm a linux neebie I don't know which files to remove...
a) The modules directory is very "deep" and I can't find the files which I'm allowed to remove.
b) "Aterm" for example is located in serveral "/usr" files - should I remove all three of them?
It would be a great help to tell me an example of how to remove an module and an application...

Thank's!






Offline gutmensch

  • Administrator
  • Hero Member
  • *****
  • Posts: 605
  • I can make it disappear, have no fear!
    • remembrance blog
Re: PXE boot and rdesktop autostart
« Reply #7 on: October 23, 2010, 07:16:18 AM »
Ok, step-by-step ;-)
1.) List modules loaded on your client, when tinycore started and maybe even started rdesktop one time (for example via usb stick)
Code: [Select]
$ lsmod2.) Note all modules (shouldn't be too much for a bare boot, e.g. there are loop, squashfs, ramzswap, ...), replace underscores with hyphens
3.) Unpack tinycore.gz to a temp folder
Code: [Select]
mkdir /tmp/unpackedtc
cd /tmp/unpackedtc
zcat tinycore.gz | sudo cpio -i -H newc -d
4.) In your remaster folder, where you extracted tinycore.gz, search for all modules except for those listed before under 2.)
Code: [Select]
find /tmp/unpackedtc/lib/modules -type f -name *.ko.gz ! -name ramzswap* ! -name loop* ! -name squashfs* -exec sudo rm -f {} \;As you can see, he won't delete the modules ramzswap, loop, squashfs, ... (! = won't, * = .ko.gz), put your other modules right into that list.
5.) Search for other "big" unneccessary files and remove them manually and carefully
Code: [Select]
find /tmp/unpackedtc -size +50k
(/usr/bin/aterm, /usr/bin/zsync, ... )
Be careful with libraries, they might be needed somewhere, Xvesa as well ;) Install rdesktop and check for it's dependencies like
Code: [Select]
ldd /usr/local/bin/rdesktop
6.) Repack your tinycore.gz and you're done!
If I seem unduly clear to you, you must have misunderstood what I said. (Alan Greenspan)

Offline achduschande

  • Newbie
  • *
  • Posts: 5
Re: PXE boot and rdesktop autostart
« Reply #8 on: October 23, 2010, 12:36:54 PM »
Ok, step-by-step ;-)
1.) List modules loaded on your client, when tinycore started and maybe even started rdesktop one time (for example via usb stick)
Code: [Select]
$ lsmod2.) Note all modules (shouldn't be too much for a bare boot, e.g. there are loop, squashfs, ramzswap, ...), replace underscores with hyphens
3.) Unpack tinycore.gz to a temp folder
Code: [Select]
mkdir /tmp/unpackedtc
cd /tmp/unpackedtc
zcat tinycore.gz | sudo cpio -i -H newc -d
4.) In your remaster folder, where you extracted tinycore.gz, search for all modules except for those listed before under 2.)
Code: [Select]
find /tmp/unpackedtc/lib/modules -type f -name *.ko.gz ! -name ramzswap* ! -name loop* ! -name squashfs* -exec sudo rm -f {} \;As you can see, he won't delete the modules ramzswap, loop, squashfs, ... (! = won't, * = .ko.gz), put your other modules right into that list.
5.) Search for other "big" unneccessary files and remove them manually and carefully
Code: [Select]
find /tmp/unpackedtc -size +50k
(/usr/bin/aterm, /usr/bin/zsync, ... )
Be careful with libraries, they might be needed somewhere, Xvesa as well ;) Install rdesktop and check for it's dependencies like
Code: [Select]
ldd /usr/local/bin/rdesktop
6.) Repack your tinycore.gz and you're done!

..wow... what should I say... IT WORKS!!! rdesktop is running!!!! THANK'S A LOT!  :D
If you can tell me how to autostart rdesktop I'll be happy forever... (I know there's a description somewhere but I didn't find the X-directory to put it in...)




Offline gutmensch

  • Administrator
  • Hero Member
  • *****
  • Posts: 605
  • I can make it disappear, have no fear!
    • remembrance blog
Re: PXE boot and rdesktop autostart
« Reply #9 on: October 23, 2010, 12:53:25 PM »
The directory for that purpose is hidden directly in your user folder, e.g. /home/tc/.X.d (the first dot is essential! ;-)
Create a file in there called rdesktop and put in it a command like
Code: [Select]
/usr/local/bin/rdesktop -f 192.168.1.100 &
The ampersand puts this process in the background!
If I seem unduly clear to you, you must have misunderstood what I said. (Alan Greenspan)

Offline achduschande

  • Newbie
  • *
  • Posts: 5
Re: PXE boot and rdesktop autostart
« Reply #10 on: October 23, 2010, 01:12:19 PM »
The directory for that purpose is hidden directly in your user folder, e.g. /home/tc/.X.d (the first dot is essential! ;-)
Create a file in there called rdesktop and put in it a command like
Code: [Select]
/usr/local/bin/rdesktop -f 192.168.1.100 &
The ampersand puts this process in the background!

This is a GREAT night for me! Werder won 4:1 and this stupid client does what I want it to do! Even autostart works - I tried autostarting aterm since my little daughter's stolen the sheet with the w2008 server passwords on it... hope I'll find it tomorrow  :-\  Everything works fine! I guess I'll use TC as as subject in school (now you know my profession...).
Linux is great, I must admit! And: thank you very much for your help!

P.S.: Nicht jeder "Gutmensch" ist auch einer!




Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: PXE boot and rdesktop autostart
« Reply #11 on: October 23, 2010, 04:54:02 PM »
@achduschande: We seem to operate in different timezones, and things appear to have progressed since I last looked at this thread. As a sort of public response to your PM (triggered by a comment in reply #3) I'd like to set the record straight: What I've suggested a few weeks ago in a different thread was a way to create a "kiosk mode" system out of "box standard" TC. In that case remastering was not a strict requirement, but it would still be a better option in the long run.

The idea is to use the 'desktop' boot code (which typically starts a WM) to instead start the "default" application (i.e. 'rdesktop' in your case). I furthermore suggested to keep a "reduced" version of 'wbar' running to allow the user either system shutdown or a "default" application restart. In an additional post I also suggested a way to limit the chances of the user to gain access to the console (and hence gain control over the system). I'd imagine that a combination of some of these suggestions can be applied in your project as well.

BTW, instead of using the 'desktop' boot code one would just have to change the entry in '/etc/sysconfig/desktop' when undertaking a initrd remastering. As a final remark: I'm realising that 'rdesktop.tcz' does not contain a .desktop file (and no icon file either), therefore no 'wbar' entry would currently be created. OTOH that can be easlily overcome, by picking a suitable icon file from somewhere else and "fudging" the respective entry as part of the remastering.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: PXE boot and rdesktop autostart
« Reply #12 on: October 23, 2010, 05:02:04 PM »
I added a paragraph to the netboot wiki article to show how minimal a PXE boot with tce and backup on NFScan be.