dreamcat4 / docker-images

Dreamcat4's Docker Images (Trusted Builds)
MIT License
160 stars 66 forks source link

PXE - ubuntu casper-rw does not try to connect to samba #49

Open dadaeu opened 4 years ago

dadaeu commented 4 years ago

Hi,

I need some help with PXE, which I installed on a second computer in my home.

I configured only the ubuntu part, including the casper-rw and home-rw files. During network boot, the menu appears, after selecting either the ubuntu casper-rw menu or the installer iso menu, it starts loading initrd and vmlinuz, then starts booting showing a lot of logs as usual during linux boot. Then, the ubuntu graphical screen appears with the logo and those 5 horizontal dots changing colors between white and red and, after a minute or two, it goes back to text mode and shows the message: (initramfs) Unable to find a live file system on the network. I used wireshark to see what happens on the network and, after downloading initrd and vmlinuz, no other packet is sent over the network. Complete silence. It's like it does not even try to connect to samba to download the rest of the files. I don't know what to do now.

Note: in ubuntu-16.04.6-desktop-amd64.iso, there is no vmlinuz.efi or initrd.lz file, but vmlinuz and initrd. I modified boot.ipxe accordingly, besides the samba ip/share/user/pass.

I attached a screenshot from a VM: PXE Ubuntu The same happens if I try to network boot my computer itself. How to debug this? Please advise, Thank you

PS: I tried the chain http://boot.salstar.sk menu, it doesn't work, not even displaying their menu (screenshot attached). PXE Salstar I also added a new menu with chain http://boot.salstar.sk/deb.ipxe and it shows their menu, but whatever selections I make, in the end it shows a couple of errors (screenshot attached). I am a little confused about this matter. PXE Salstar Deb

dreamcat4 commented 4 years ago

Hey there, Have not used this myself for a long time. However I am guessing for the first issue you might need to go deeper into the ubuntu initrd environment. That is 2 part. One side is examining the ubuntu initrd (before make initramfs command generated the initrd image)... that is something that requires a working ubuntu system. You install initrd tools package. Then dpg -L to see where its been installed to. All this casper image mounting stuff eover samba tc is being done by those scripts.

Perhaps I also patched certain critical parts of some script inside the initrd image? ...I cannot remember anymore now.

The other thing to do is interactively drop to shell when the initrd fails. And to try and poke around in there. Your ability to see what is going on inside the initrd environment is mostly hampered by a complete lack of diagnostic tools. Many basic commands are missing... so it might actually require you to add in certain missing cmdline tools and remake youself the initrd image. Anyhow if you can at least do an ip addr cmd in there to basically check that the initrd image has a working network interface. And ping or telnet or nmap tools can help you check beyond that it can additionally see the samba share.

Beyond that... its a bit overwhelming because you have multiple different errors going on there. PXE booting from a docker image was never simple to begin with.

dreamcat4 commented 4 years ago

Some further tips after that:

See here

https://github.com/dreamcat4/docker-images/blob/e793b29f43a8c31aa2a01a77c3e80a54d8d7cbb3/pxe/pxe.default/ipxe/boot.ipxe#L65-L103

and here

https://github.com/dreamcat4/docker-images/blob/master/pxe/pxe.default/iso/extracted/modified/ubuntu-16.04-desktop-amd64/casper/initrd_lz/scripts/casper-helpers.diff

Makes sure you follow additional readme instructions here

https://github.com/dreamcat4/docker-images/tree/master/pxe/pxe.default/iso/extracted/clean/ubuntu-16.04-desktop-amd64

and also populate this folder with real files. They must all be unpacked from the iso

https://github.com/dreamcat4/docker-images/tree/master/pxe/pxe.default/iso/extracted/clean/ubuntu-16.04-desktop-amd64/casper

You might need to repack the initrd archive after patching the casper helper script...

If you were to drop into interactive shell when initrd image fails (the halted boot you showed earlier).

and then check around line 200 of its scripts/casper-helpers that the initrd has booted into.