Proxmox installation via PXE: solution

Hi

Just to say that I tested this method with the 3.1 version and it works too.

Step 4 is no longer necessary because the code has been integrated in the original file, at the condition that you rename the original ISO file as 'proxmox.iso'
 
Just tried to push a customized initrd on my PXE but get stucked on

VFS: Cannot open root device "<NULL>" or unknown-block(8,1)
Please append a correct "root=" boot option; here are the available partions:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,1)

If I use the original initrd, it comes to cdrom detection error (of coarse)
I've tried to diff my initrd with the original one and proxmox.iso file is the only difference.
Did not change init script until it this now included in the native code.

Did try several kernel option on my PXE config file with no more success.

Any idea would be appreciated until we use PXE for every staging tasks.

Thx
 
So where are people at with doing unattended installs of proxmox hosts? Seems to be a lot of different ideas here and I am just wondering what actually works.
 
Got it working with Proxmox VE 3.1!

I used the script from mrballcb and copied the 2 files (linux26 and initrd.iso.img) to my SERVA PXE Server.

Here is my ServaAsset.inf for the pxe boot menu.

[PXESERVA_MENU_ENTRY]
asset = Proxmox VE 3.1
platform = x64
kernel = NWA_PXE/$HEAD_DIR$/linux26
append = initrd=NWA_PXE/$HEAD_DIR$/initrd.iso.img vga=791 video=vesafb:ywrap,mtrr ramdisk_size=16777216 splash=verbose

If you need some boot options for your installation, just add them to the append line. i.e. filesystem ext4, 4 GB pve-root, 4 GB swap
append = initrd=NWA_PXE/$HEAD_DIR$/initrd.iso.img vga=791 video=vesafb:ywrap,mtrr ramdisk_size=16777216 linux ext4 maxroot=4 swapsize=4 splash=verbose

 
Hi

Just to say that I tested this method with the 3.1 version and it works too.

Step 4 is no longer necessary because the code has been integrated in the original file, at the condition that you rename the original ISO file as 'proxmox.iso'


I did it the way it says, and now that i skip[ step 4 it goes further then before. But for me, if halts and says NO HARD DISK DRIVE FOUND. I know it is there. I see it and so does the bios.

any clues or suggestions?
 
Thanks a lot, in works fine :)

Are there other option in the "APPEND" line available like, default Mail or rootpassword, or IPAdress to set ... for full automatic install?
 
Updated Version...

Code:
#!/bin/bash

#########################################################################################################
# Create PXE bootable Proxmox image including ISO                                                       #
#                                                                                                       #
# Author: mrballcb @ Proxmox Forum (06-12-2012)                                                         #
# Thread: http://forum.proxmox.com/threads/8484-Proxmox-installation-via-PXE-solution?p=55985#post55985 #
# Modified: morph027 @ Proxmox Forum (23-02-2015) to work with 3.4                                      #
#########################################################################################################

BASEDIR=${1:-./}
pushd $BASEDIR >/dev/null

[ -L "proxmox.iso" ] && rm proxmox.iso &>/dev/null

for ISO in *.iso; do
    if [ "$ISO" = "*.iso" ]; then continue; fi
    if [ "$ISO" = "proxmox.iso" ]; then continue; fi
    echo "Using $ISO..."
    ln -s "$ISO" proxmox.iso
done
if [ ! -f "proxmox.iso" ]; then
    echo "Couldn't find a proxmox iso, aborting." 
    echo "Add /path/to/iso_dir to the commandline." 
    exit 2
fi
[ -d pxeboot ] || mkdir pxeboot
pushd pxeboot >/dev/null
[ -d mnt ] || mkdir  mnt
echo "Mounting iso image..." 
if ! mount -t iso9660 -o ro,loop ../proxmox.iso mnt/ ; then
    echo "Failed to mount iso image, aborting." 
    exit 3
fi
echo "copying kernel..."
cp  mnt/boot/linux26 .
rm -f  initrd.orig initrd.orig.img initrd.img
echo "copying initrd..."
cp  mnt/boot/initrd.img initrd.orig.img
if ! umount  mnt ; then
    echo "Couldn't unmount iso image, aborting."
    exit 4
fi

echo "Unmounted iso, extracting contents of initrd..." 
gzip -d -S ".img" ./initrd.orig.img
rm -rf initrd.tmp
mkdir  initrd.tmp
pushd initrd.tmp >/dev/null
echo "Added iso, creating and compressing the new initrd..." 
cpio -i -d < ../initrd.orig 2>/dev/null
cp ../../proxmox.iso proxmox.iso
(find . | cpio -H newc -o > ../initrd.iso) 2>/dev/null
popd 2>/dev/null
rm -f initrd.iso.img
gzip -9 -S ".img" initrd.iso

# Now clean up temp stuff
echo "Cleaning up temp files..." 
rmdir  mnt
rm -rf initrd.tmp
rm  ./initrd.orig

echo "Done!  Look in $PWD for pxeboot files." 
popd 2>/dev/null
popd 2>/dev/null
 
Hi
VFS: Cannot open root device "<NULL>" or unknown-block[SOLVED]

Just tried to push a customized initrd on my PXE but get stucked on

VFS: Cannot open root device "<NULL>" or unknown-block(8,1)
Please append a correct "root=" boot option; here are the available partions:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,1)

If I use the original initrd, it comes to cdrom detection error (of coarse)
I've tried to diff my initrd with the original one and proxmox.iso file is the only difference.
Did not change init script until it this now included in the native code.

Did try several kernel option on my PXE config file with no more success.

Any idea would be appreciated until we use PXE for every staging tasks.

Thx

Im recive this error while trying install Proxmox v3.3 and v3.4 with PXE on IDE HDD, VM and hardware machine, also SATA HDD on IDE mode
After changing HDD on SATA problem solved.
 
Whilst working through this solution I made an observation which may help those of you suffering from the problem with errors about not being able to mount a root device.

When I did the cpio extract there was lots of mknod errors.

Part of the initrd includes a dev directory with special device files created by mknod, these special device files are needed for mounting block devices such as disks.

The important bit is that mknod must be run as root, so if you have run this script (or performed the cpio manually) as a non-root user then it's likely the device entries will be broken - I suspect this is what is causing the errors regarding mounting of root device.

Hope that helps someone.
 
Hi everyone and thanks a lot for bringing that script up on Github. Great work!

I am actually still stumbling into issues with the VFS mount issue SteamKelevra mentioned earlier. I used your script to create the linux26 kernel and the initrd.iso.img, boot it with all the parameters and made sure that the hardware in my VM is SATA, although the issue is still the same. I ran the script on an Ubuntu 14.04 LTS. Anyone got an idea?

My iPXE boot config looks the following (the server is public, so please feel free and try to boot from those files):
#!ipxe
dhcp
echo booting proxmox
initrd $domain/proxmox/3.4/initrd.iso.img splash=verbose
chain $domain/proxmox/3.4/linux26 vga=791 video=vesafb:ywrap,mtrr ramdisk_size=16777216 || goto failed
goto start

I tried "ramdisk_size=524288" as well, but still the same error. Booting the VM from the regular 3.4/4.0 ISO just works fine.

The issue looks the following:
Screen Shot 2015-10-21 at 7.10.29 PM.jpg

Any help is welcome, thanks so much!

Bests,
Florian

PS: I can't post links here yet (account too new), so if anyone wants to have the URL to boot from then please replace $domain with http : // beta.netboot.me
 
We use also Ubuntu with tftp-hpa:

Code:
LABEL Proxmox
    MENU LABEL Proxmox PVE Environment 4.0
    TEXT HELP
         Installiert einen Virtualisierungshost mit Proxmox 4.0
    ENDTEXT
    LINUX proxmox4/linux26
    APPEND vga=791 video=vesafb:ywrap,mtrr ramdisk_size=524288 linux ext4 maxroot=10 swapsize=4 splash=verbose
    INITRD proxmox4/initrd.iso.img
 
fireon, this means your setup is working or do you have the same issues?

Thanks,
Florian

We use also Ubuntu with tftp-hpa:

Code:
LABEL Proxmox
    MENU LABEL Proxmox PVE Environment 4.0
    TEXT HELP
         Installiert einen Virtualisierungshost mit Proxmox 4.0
    ENDTEXT
    LINUX proxmox4/linux26
    APPEND vga=791 video=vesafb:ywrap,mtrr ramdisk_size=524288 linux ext4 maxroot=10 swapsize=4 splash=verbose
    INITRD proxmox4/initrd.iso.img
 
Hi ...
i successfully got it till the point that the installer boots up and the install is finished -
but i cannot boot from the freshly installed machine.
It seems to fail on getting GRUB in place.
tried several machines with different drives - nu luck so far.

any ideas?

cheers / ralf
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!