Tiny Core Linux

General TC => General TC Talk => Topic started by: Zendrael on September 06, 2013, 07:51:59 AM

Title: [SOLVED] Absolute Minimum Netbooting problems
Post by: Zendrael on September 06, 2013, 07:51:59 AM
Hello all!

Following the Absolute Minimum Netbooting Method from the Wiki, I still can't get my clients to boot... they get some IP address but TFTP gives me an error (screenshot attached).

What should get wrong here?

I'm using (Tiny)Core 4.7.7.
Title: Re: Absolute Minimum Netbooting problems
Post by: gerald_clark on September 06, 2013, 08:08:38 AM
What is client01.pxe?
You should be loading pxelinux.0.
Title: Re: Absolute Minimum Netbooting problems
Post by: Zendrael on September 06, 2013, 08:17:19 AM
Hello Gerald_Clark!

I just followed the instructions in the wiki... So, I don't know what is happening, never tested it (the netbooting) before... And in the wiki it doesn't say about pxelinux.0....

Any clues? Ideas? Everything is welcome! =)
Title: Re: Absolute Minimum Netbooting problems
Post by: gerald_clark on September 06, 2013, 09:50:48 AM
What wiki article are you referring to?
Title: Re: Absolute Minimum Netbooting problems
Post by: Zendrael on September 06, 2013, 09:55:58 AM
This one: http://wiki.tinycorelinux.net/wiki:netbooting

I have configured the Terminal Server app as described then I started folowing the Absolute Minimum step as described too.

Title: Re: Absolute Minimum Netbooting problems
Post by: gerald_clark on September 06, 2013, 10:02:34 AM
Where in there do you see a client01.pxe?

The absolute minimum method does not refer to an absolute minimum method of netbooting.
It is the absolute minimum changes you need to make to a working pxe boot system to allow for a persistent tce directory on nfs.

Get your pxe boot working before you try any of the network based tce directory options.
Title: Re: Absolute Minimum Netbooting problems
Post by: Zendrael on September 06, 2013, 10:18:21 AM
Gerald_Clark, thanks for your reply!

I have no file called client01.pxe... I just have my server and another machine in a VM environment. The client VM (VirtualBox) is called client01 so, if I change its name (for workstation, for exemple) it changes the name of the <file>.pxe... In the server I did nothing about it.

So, if the absolute minimum refers just to persistence, should my system boot just by using the Terminal Server app, right? Well... it is not working... I'm still getting the same error from TFTP... My VirtualBox Server and Client are in the same network.

My setup:
-SERVER VM
   - (Tiny)Core 4.7.7
   - Network adapter 1: (eth0) NAT
   - Network adapter 2: (eth1) Internal Network
- CLIENT VM
   - PXE Boot thru Network adapter 1: Internal Network
Title: Re: Absolute Minimum Netbooting problems
Post by: gerald_clark on September 06, 2013, 01:01:58 PM
I don't use the terminal server app.
My pxe boot server is CentOS.
You need to get your server's dhcp, tftp, and pxe configuration fixed so you can pxe boot the basic vmlinuz and core.gz files.
Once you have that working, you can add the network persistence to your  pxelinux.cfg/default file.
Title: Re: Absolute Minimum Netbooting problems
Post by: Zendrael on September 06, 2013, 03:53:24 PM
Hello Gerald_Clark!

Got the machines booting ok!

Did the "Putting all together" from the wiki but still no nfs... even when I do "ls /mnt/" on the clients, there are just "sr0".

Maybe am I missing something? I get no erros too...

Put a default file at /tftpboot/pxelinux.conf/ with the menu described. Is it correct?
Title: Re: Absolute Minimum Netbooting problems
Post by: gerald_clark on September 06, 2013, 04:05:56 PM
The server you specify must have an nfs server running with the specified directory exported.
Title: Re: Absolute Minimum Netbooting problems
Post by: Zendrael on September 06, 2013, 05:37:10 PM
I have nfs-utils loaded into the server and already did the exportfs -a after changes in the /etc/exports.

Should I run any command to start the nfs server?
Title: Re: Absolute Minimum Netbooting problems
Post by: gerald_clark on September 06, 2013, 06:00:14 PM
/usr/local/etc/init.d/nfs-server start
Title: Re: Absolute Minimum Netbooting problems
Post by: Zendrael on September 07, 2013, 08:46:06 AM
Followed all the steps again and after starting the server, had some messages (attached because I could not copy and paste from the VM to here) and still does not work... I can't see the PXE menu either...

Edit: (Attached a client machine booting messages too)
Title: Re: Absolute Minimum Netbooting problems
Post by: Rich on September 07, 2013, 11:01:44 AM
Hi Zendrael
The  nfsd  message in the first picture suggests you need to install  filesystems-3.0.21-tinycore.tcz
Title: Re: Absolute Minimum Netbooting problems
Post by: Zendrael on September 07, 2013, 11:29:58 AM
Hi Rich!

I've installed and loaded it at boot now. But the clients still don't have a /mnt/nfs after booting...

Also I added the pxelinux.0 to the directory /tftpboot/ copying it from /usr/share/syslinux/ - nothing changed...

I tryied to change the default file in the pxelinux.cfg dir to become the client Mac Address and no luck with that too... When my client boots, the Terminal Server app in the server drops a lot of "tftp: can't open file" messages... like if it doesn't know where to find the files...
Title: Re: Absolute Minimum Netbooting problems
Post by: genec on September 07, 2013, 01:47:38 PM
A plain tftp client helps diagnose files that can't be opened.

Also, with the client01.pxe, I'll bet that's the result of being on the NAT network and VirtualBox handing stuff out.

Put a default file at /tftpboot/pxelinux.conf/ with the menu described. Is it correct?

pxelinux.cfg/ should be your directory name.
Title: Re: Absolute Minimum Netbooting problems
Post by: Zendrael on September 08, 2013, 08:13:03 AM
Hi Genec!

Ooops, the pxelinux.conf was a typo... the directory is pxelinux.cfg already!

The issue with the first screenshot was solved, I had to use a internal network in virtualbox to get the clients booting.

When the client is booting, it says that the prefix of TFTP is "/"... maybe I can change this to pxelinux.cfg in some way?

The booting process is working, just the nsf is not...
Title: Re: Absolute Minimum Netbooting problems
Post by: Akane on September 09, 2013, 06:23:54 AM
Hi Zendrael.

What files is the PXELinux reading?
( maybe '01-...', 'C...', and 'default'.)
And what path is pointed?

Please list them.

Regards,
Akane.
Title: Re: Absolute Minimum Netbooting problems
Post by: Zendrael on September 09, 2013, 07:54:13 AM
Hey Akane!

I had in the pxelinux.cfg directory two files, one is 01-<mac_address> and the other is "default" - both have the same information as I'm testing with only a client at the moment.

But, which path is being pointed, I don't know, as I thought that the default path is /tftpboot/pxelinux.cfg... And, as you can see in one of the last screenshots, the tftp say that the prefix is "/" but can't find any files...

Maybe I have some problems with permissions? Can I use "chmod 777 -Rf" in the tftpboot directory without compromising other configs?
Title: Re: Absolute Minimum Netbooting problems
Post by: Akane on September 09, 2013, 08:07:52 AM
Hi Zendrael.

Oh sorry. I did not notice the picture.

So now, the PXE client can load the config file and can be booted, right?

Excuse me but I did not understand what is the problem now?

Regards,
Akane.
Title: Re: Absolute Minimum Netbooting problems
Post by: Zendrael on September 09, 2013, 08:24:01 AM
Hi Akane!

The PXE client is not loading the config.

I keep receiving the "tftpd: can't open file" in the Terminal Server app and the only thing that the client do is boot up the base (without any extensions) of the Core...
Title: Re: Absolute Minimum Netbooting problems
Post by: Akane on September 09, 2013, 08:28:36 AM
Hi Zendrael!

Now I understand. Thank you!

In the base of the core, could you run `cat /proc/cmdline` and upload the result please?

Regards,
Akane.
Title: Re: Absolute Minimum Netbooting problems
Post by: Zendrael on September 09, 2013, 08:36:02 AM
Hello Akane!

Attached is the result of the command in the server and in the client (as the filename suggests).

Hope it could be helpful!

Thanks for your help!
Title: Re: Absolute Minimum Netbooting problems
Post by: Akane on September 09, 2013, 09:02:11 AM
Hi Zendrael!

Thank you for the photos.

The command line lacks 'nfsmount=' option.
Where did you put 'tcz' directory for client?
Please add below to the PXELinux configuration file. (DIRECTORY is the place that you installed 'tcz' directory for client.)
Code: [Select]
nfsmount=servidor:DIRECTORY(If the 'tcz' directory is '/tftpboot/tcz', replace DIRECTORY /tftpboot)

Please try.

Regards,
Akane.
Title: Re: Absolute Minimum Netbooting problems
Post by: Akane on September 09, 2013, 09:03:04 AM
Note that :D is ':' and 'D'.
Title: Re: Absolute Minimum Netbooting problems
Post by: Zendrael on September 09, 2013, 09:12:47 AM
Hey Akane!

The option is in the "default" and "01-<mac_address>" inside pxeliunux.cfg, inside tftpboot like:

/tftpboot/pxelinux.cfg/default

The problem is that the clients are not reading the files inside pxelinux.cfg... They boot because of the TerminalServer app in the server, but they not read the files inside pxelinux.cfg
Title: Re: Absolute Minimum Netbooting problems
Post by: Akane on September 09, 2013, 09:22:53 AM
Hi Zendrael.

Maybe you are wrong.
Sans PXELinux configuration file, client cannot load any other file such as kernel.

So the client loads the configuration file normally.

I'm sorry to trouble you but please show me the pxelinux.cfg/default.

Regards,
Akane.
Title: Re: Absolute Minimum Netbooting problems
Post by: Zendrael on September 09, 2013, 09:29:45 AM
Hey Akane!

The pxelinux.cfg/default is:

Code: [Select]
label ws1
  MENU LABEL WS1
  kernel /nfs/ws1/vmlinuz
  append initrd=/nfs/ws1/core.gz nfsmount=servidor:/tftpboot/nfs/ws1 tftplist=servidor:/nfs/ws1/nfs.list tce=nfs/tce

And yes, the directories exist and the files vmlinuz and core.gz are there too.

I said that the clients are not reading the files because the server drops that "tftpd: can't open file" just when the clients are trying to read them...

So, by not reading them, they boot thru the vmlinuz and core of the server configured in the Terminal Server app.


Title: Re: Absolute Minimum Netbooting problems
Post by: Akane on September 09, 2013, 10:30:44 AM
Hi Zendrael!

Ummmm... I see.
That's really strange.
Thank you.

I think "tftpd: can't open file" is okay because there are no 'C', 'C0' and so on.

I am really sorry but please show me /etc/udhcpd.conf (on the server) and the outputs of 'ps | grep tftpd' (on the server).

Regards,
Akane.
Title: Re: Absolute Minimum Netbooting problems
Post by: Zendrael on September 09, 2013, 10:45:55 AM
Hi Akane!

The "ps | grep tftpd" returns the attached image01.

There is no /etc/udhcpd.conf... BUT as the ps shows a "/netboot" directory, I was looking at it and inside it, there is a udhcpd.conf! The image02 attached show its contents.

I'm really lost on it... maybe I should restart everything from the ground...
Title: Re: Absolute Minimum Netbooting problems
Post by: Akane on September 09, 2013, 10:56:33 AM
Hi Zendrael!

Thank you very much!

Possibly the Terminal Server is locating all files for network boot(including pxelinux.cfg/*) into '/netboot'.

If it is correct, there is 'default' configuration file in '/netboot/pxelinux.cfg'. (not 'tftpboot')
Please check.

I wish you well!

Regards,
Akane.
Title: Re: Absolute Minimum Netbooting problems
Post by: Zendrael on September 09, 2013, 11:57:10 AM
Hi Akane!

Yes, I was playing with this directory now! Will redo all of my configs then I'll post back here to say whats worked or not!

The tests may take some time, will post again just tomorrow!

Thanks for your help! When everything works, maybe I will update or put some tips in the wiki.
Title: Re: Absolute Minimum Netbooting problems
Post by: Zendrael on September 09, 2013, 12:41:54 PM
Ok!

Now there is a /mnt/nfs directory in the clients after they boot up! The directory contain a tce dir with onboot.lst, ondemand and optional directories - all of them are empty!

I (re)created the /tftpboot/nfs/ws1 directory and inside it  tce directory with some extensions. None is loaded. I have this added to the client boot file:
Code: [Select]

nfsmount=myserver:/tftpboot/nfs/ws1
and, as you can imagine, what is mounted in the clients is not what this directory contain... even if I try to create a file inside /mnt/nfs in the client, it doesn't show up in the server....

Almost there!!!
Title: Re: Absolute Minimum Netbooting problems
Post by: Akane on September 09, 2013, 06:36:09 PM
Hi Zendrael!

Sorry for late because I was sleeping.
Congratulations!

It seems that the client did not mount the NFS share or the client mounted different directory.

So please upload the contents of /etc/exports on the server and the result of running command 'mount' on the client.

Regards,
Akane.
Title: Re: Absolute Minimum Netbooting problems
Post by: Zendrael on September 10, 2013, 07:28:57 AM
Hi Akane!

To sleep is good for your brain! I wish I could do more of it! Hahaha!

Attached are the commands you requested, including the "exportfs -a" which always gave me some messages too.

I have a good feeling about this, we will get there soon!

Thanks!
Title: Re: Absolute Minimum Netbooting problems
Post by: Akane on September 10, 2013, 07:49:50 AM
Hi Zendrael!

Thank you for your pictures.

It seems that NFS daemon on server is not running (because the server could not load nfsd kernel module).

I think the kernel version you showed (3.0.21-tinycore) may be incorrect.
Did you 'tce-load'ed 'filesystems-KERNEL'?

Sorry for my ambiguous opinions (because I do not have any PC on that TC can run).
Please show me the result of the command 'uname -r' (kernel version).

Regards,
Akane.
Title: Re: Absolute Minimum Netbooting problems
Post by: Zendrael on September 10, 2013, 07:56:27 AM
Hi Akane!

uname -r shows
Code: [Select]
3.0.21-tinycore
and I have filesystems-3.0.21-tinycore loaded at boot on the server (confirmed with tce-status -i)

Title: Re: Absolute Minimum Netbooting problems
Post by: Akane on September 10, 2013, 07:59:38 AM
Hi Zendrael!

Oh. I see.

Then, please run the command 'depmod' as root and restart nfs-server.
If there are some errors, please show them.

Regards,
Akane.
Title: Re: Absolute Minimum Netbooting problems
Post by: Zendrael on September 10, 2013, 08:04:21 AM
Hey Akane!

The depmod command returned nothing and when restarting the nfs-server I get some messages (attached)

This is becoming a real challenge! Hahahahah

Thanks!
Title: Re: Absolute Minimum Netbooting problems
Post by: Akane on September 10, 2013, 08:08:59 AM
Hi Zendrael!

Okay. Thank you!

Now you can network boot the client, maybe.
Please try!

Regards,
Akane.
Title: Re: Absolute Minimum Netbooting problems
Post by: Zendrael on September 10, 2013, 08:10:55 AM
Hi Akane!

The client is booting up, just don't load any extensions and don't mount the nfs share in the server (where the extensions are).
Title: Re: Absolute Minimum Netbooting problems
Post by: Akane on September 10, 2013, 08:14:07 AM
Hi Zendrael!

Thank you.
Hmmm... That's strange.

Can you mount the NFS share on the server?
For example,
Code: [Select]
$ mkdir /tmp/nfs-share
$ sudo mount -t nfs myserver:/tftpboot/nfs/ws1 /tmp/nfs-share

Regards,
Akane.
Title: Re: Absolute Minimum Netbooting problems
Post by: Zendrael on September 10, 2013, 08:27:04 AM
Hi Akane!

I agree, really strange... the command gave an error too... attached is what I've got.

Thanks again!
Title: Re: Absolute Minimum Netbooting problems
Post by: Akane on September 10, 2013, 08:37:54 AM
Hi Zendrael!

Hmmm...

First, run the command 'chmod 777 /tftpboot/nfs/ws1', 'exportfs -ra' and retry net booting.

If it fails again, then replace /etc/exportfs like below.
Code: [Select]
/tftpboot/nfs/ws1 (rw,no_root_squash,fsid=0)
Then run the command 'exportfs -ra' and retry net booting.

Regards,
Akane.

Title: Re: Absolute Minimum Netbooting problems
Post by: Zendrael on September 10, 2013, 08:52:10 AM
Hey Akane!

The directory was chmoded as 777 earlier then I did it again and, after adding the fsid on the /etc/exports, the error in the clients changed as follows (attached)

Thanks again!
Title: Re: Absolute Minimum Netbooting problems
Post by: Akane on September 10, 2013, 08:57:28 AM
Hi Zendrael!

Oh! Sorry.
Please restart NFS daemon after 'exportfs -ra'ing.

Regards,
Akane.
Title: Re: Absolute Minimum Netbooting problems
Post by: gerald_clark on September 10, 2013, 09:45:44 AM
Unless you have installed and started the nfs-client service on the client, you will need to add the -o nolock mount option.

mount -o nolock 192.168.56.103:/tftpboot/nfs/ws1 /tmp/nfs
Title: Re: Absolute Minimum Netbooting problems
Post by: Zendrael on September 10, 2013, 10:05:03 AM
Hi all!

Good news: the client booted up and the /mnt/nfs is the nfs share on the server, it even can write to it and I can see the files in the server!

What still didn't worked: the extensions are not loaded!

Almost there!!!
Title: Re: Absolute Minimum Netbooting problems
Post by: Akane on September 10, 2013, 10:08:25 AM
Hi Zendael!

Great!

Then append 'tce=nfs' to the command line of the client.
It would work soon!

Regards,
Akane.
Title: Re: Absolute Minimum Netbooting problems
Post by: Zendrael on September 10, 2013, 10:23:10 AM
Hi Akane!

Added, restarted and not loading extensions yet... The extensions are in the server, inside /tftpboot/nfs/ws1/tce/optional/

Gerald_clark, thanks by your help, just didn't test because the nfs mount in the boot worked.

Yeah, I believe it will work soon!

Thanks!
Title: Re: Absolute Minimum Netbooting problems
Post by: Akane on September 10, 2013, 10:31:21 AM
Hi Zendrael!

Hmmm...
Something is wrong.

Could you add 'pause' boot option for the client, boot him(her) and show us the boot messages?

Regards,
Akane.
Title: Re: Absolute Minimum Netbooting problems
Post by: gerald_clark on September 10, 2013, 10:36:38 AM
Does your tce directory have a valid onboot.lst?

Post the output of 'showbootcodes' on the client.
Title: Re: Absolute Minimum Netbooting problems
Post by: Zendrael on September 10, 2013, 10:45:10 AM
Hello!

@Akane, attached is the result after adding 'pause' to the boot of the clients.

@Gerald_clarck, attached is also the result of 'showbootcodes'

In the /tftpboot/nfs/ws1/tce (in the server) I have an onboot.lst that contain:
Code: [Select]
/nfs/ws1/tce/optional/<extension_names>.tcz(one extension per line)

Maybe the problem is this file?
Title: Re: Absolute Minimum Netbooting problems
Post by: curaga on September 10, 2013, 10:48:55 AM
onboot.lst should not contain paths.
Title: Re: Absolute Minimum Netbooting problems
Post by: Akane on September 10, 2013, 10:50:19 AM
Hi Zendrael!

It seems that the extensions are loaded normally.

Are the extensions you want to load listed in the onboot.lst?

If they are listed, append 'showapps' command line option for the client and show us the boot messages.

Regards,
Akane.
Title: Re: Absolute Minimum Netbooting problems
Post by: Zendrael on September 10, 2013, 10:51:48 AM
WOW, IT WORKED!

I copied the onboot.lst from the server, and it booted up and even loaded the Xvesa, wbar... =)

Last step (i guess) the internet connection!

The server has two interfaces, one eth0 connected to the internet and the second eth1 used to share the dhcp to the clients. BUT the server only works online if the second is disabled... the clients are using the server IP as Gateway.
Title: Re: Absolute Minimum Netbooting problems
Post by: Akane on September 10, 2013, 10:55:34 AM
Congratulations!

To set true gateway(TRUEGATEWAY), run these commands AS ROOT:
Code: [Select]
# route del default
# route add -net default gw TRUEGATEWAY

Regards,
Akane.
Title: Re: Absolute Minimum Netbooting problems
Post by: Zendrael on September 10, 2013, 11:01:10 AM
Hi Akane!

Did the commands in the server, it still did not get online, neither the clients.

Do I have to run these commands on every reboot of the server?

If I disable the eth1 (from hardware) in the server, he gets online. With the two network cards, seems like he gets lost... and didn't get online (even getting the right IP)
Title: Re: Absolute Minimum Netbooting problems
Post by: gerald_clark on September 10, 2013, 11:09:31 AM
If you intend to use 2 ethernet adapters, you will need to set them up manually in bootlocal.sh.
If you intend to use the server as a router/gateway you will need to do a lot more work, including installation and configuration of
iptables, and enabling forwarding.

To be honest, someone with your experience should not be building internet facing servers.
Buy a consumer DSL/CABLE router and install your servers behind it.
Use it to share your internet connection with your home network.
Title: Re: Absolute Minimum Netbooting problems
Post by: Zendrael on September 10, 2013, 01:21:08 PM
Hi Mr. Gerald_Clark!

I'm used to build LTSP servers with Ubuntu and Debian, LAMP servers and File Servers for small business... But even using Core since version 2, I wasn't feeling confortable to change the working servers replacing the existing distros by Core so I never tryied it before...
Now I have a new project (a charity project) for a small room for children to access internet and learn how to use computers, all machines were donated and my intent is to use Core because in the few years that I use Linux (about 12 years) it's the best distro in many ways following the KISS method.

Maybe you are right, I should not be build servers as I'm more a programmer than a Network Adm... But, well, I'll keep trying!

Thanks again for the help!  :D

Title: Re: Absolute Minimum Netbooting problems
Post by: Zendrael on September 11, 2013, 08:06:19 AM
Everybody that helped, thank you very much!

As the objective of the topic was to get the clients booting up and loading the NFS share on the server and now it is working, will mark this topic as solved!

Thank you again!

The Core community is really helpful and all the team is great!
Title: Re: Absolute Minimum Netbooting problems
Post by: genec on September 12, 2013, 07:56:32 PM
I'm used to build LTSP servers with Ubuntu and Debian, LAMP servers and File Servers for small business.

Maybe you are right, I should not be build servers as I'm more a programmer than a Network Adm... But, well, I'll keep trying!

There's nothing necessarily wrong with building the servers however I'd agree that you should drop them behind a consumer-class DSL/Cable router until you learn how to appropriately build a proper system in a lab (including routing rules, possibly NAT rules, firewall rules, hardening/updates).  For any publicly-exposed servers, firewall rules and hardening/updates are still necessary.