[TUTORIAL] Headless building Proxmox server solution

phimat

Member
Nov 29, 2020
10
2
8
Install Proxmox on a headless server without drive swapping or pre-installing Debian, using ZFS (if required), assuming the server will boot from USB and has some form of serial (RS232) access - I used usb-serial adapter. This worked for me – YMMV.

Overview
  • use (eg) laptop to install basic Proxmox on a usb stick to make a “prox-live” system
  • modify “prox-live” to work in the headless server
  • boot headless server from “prox-live” usb stick
  • create VM attached to physical disk(s), proxmox installer as boot iso
  • install proxmox in VM
  • modify proxmox vm to work in native host
  • boot headless from it’s own disks.
  • Drink coffee while installing updates

UEFI
If your headless server uses UEFI and you don’t have serial console access to the BIOS, you may have problems here. Make sure the laptop used in the first step boots in UEFI mode to get a UEFI compatible “prox-live” image. This method does not add a UEFI boot entry but my headless server still boots ok.
If you put in the extra effort to make a UEFI “prox-live” usb drive, it appears to work for both UEFI and legacy BIOS hosts.

Detail
  • boot laptop from proxmox install dvd (v7.3-3). 32Gb usb drive disk attached
    • accept license
    • Target harddisk = /dev/sdb (28gb), Next
    • set country
    • set (temp) password
    • set (temp) IP valid for your network
    • install …
  • boot laptop from prox-live usb stick
  • Login on the console.
  • Enable serial console. Often ttyS0 is the external D9 COM port, ttyS1 might be IPMI/BMC Serial-Over-Lan console. I used a USB serial adapter.
  • systemctl enable getty@ttyUSB0.service
  • systemctl start getty@ttyUSB0.service
  • If you know the network device name(s) on the headless server (https://wiki.debian.org/NetworkInterfaceNames) then edit /etc/network/interfaces to match, otherwise we need to do this via the serial console after booting the headless system.
  • shutdown -h now
  • boot headless server from the prox-live usb stick
  • if you already configured the network card, it should appear on the network
  • otherwise ...
    • configure your serial terminal to 9600 baud
    • watch the serial console – expect nothing until login prompt.
    • login as root
    • cat /etc/network/interfaces (to see old interface name)
    • ip addr (to show network device names)
    • sed -i ‘s/ens0/enp4s0f0/g’ /etc/network/interfaces (eg, to replace ens0 with enp4s0f0 )
    • reboot, or just service networking restart
  • Connect to the web-ui on the configured temp IP address
  • load the proxmox install .iso, either
    • use web-gui to upload, or
    • scp it to root@{ip addr}:/var/lib/vz/template/iso/
  • create a VM with spec as near to the host server as possible
    • configure as many disks as you want the installer to use (eg for zRAID) but make them only 1Gb big – there’s not much space on that USB stick !
    • Use the correct bus type (eg sata/ide/scsi)
    • If UEFI boot is needed, add UEFI disk
  • Open a shell – either in web-ui or ssh root@prox-live
    • ls -l /dev/disk/by-id (to find the full names of local real disks)
    • ** Note existing data can make this look confusing. Ignore all “...-part” rows
    • replace the disks in the VM config with the real disks …
    • qm set 100 -sata0 /dev/disk/by-id/ata-ST3000DM001-1CH166_Z1F41BLC
    • qm set 100 -sata1 /dev/disk/by-id/ata-ST3000DM001-1CH166_Z1F82BLD
  • Start the VM and connect to the console
  • for UEFI mode add boot item as in https://pve.proxmox.com/wiki/OVMF/UEFI_Boot_Entries and also disable Secure Boot in OVMF settings
  • - I had to hit Esc quick to select dvd as the boot device due to previous disk contents.
  • Install PVE as normal, as required for live headless server.
    • Ignore the “virtualisation not supported” message.
    • If using ZFS, remember to reserve space for swap.
  • VM reboots after install
  • login to VM as root
    • enable serial access if required, either as above (login only) or by changing kernel boot parameters as in here to also see boot messages
    • shutdown the VM
  • shutdown the prox-live instance
  • remove prox-live media & reboot server
  • headless server should boot from it’s own disk now
  • login on serial console to …
    • fix network card names in interfaces file as above
    • reboot
  • Working system ! – but don’t forget to add swap as usual.

So we have a working (if long) procedure. Now over to anyone who can offer improvements or shortcuts :)

Phil.
 
  • Like
Reactions: Lukas Wagner
Hey, nice jobs :)
Do you think you could to pretty the same things, but more like How to remove gpu after proxmox installation ? :)
 
All my servers have built-in VGA video so I can't test this, but from a quick google it appears you need to add
GRUB_CMDLINE_LINUX_DEFAULT="nomodeset"
to /etc/default/grub and run
update-grub

Phil.
 
All my servers have built-in VGA video so I can't test this, but from a quick google it appears you need to add
GRUB_CMDLINE_LINUX_DEFAULT="nomodeset"
to /etc/default/grub and run
update-grub

Phil.
Well, I'm not familiar with grub update, and was thinking it was an heavy and dirty way to do it.
 
All my servers have built-in VGA video so I can't test this, but from a quick google it appears you need to add
GRUB_CMDLINE_LINUX_DEFAULT="nomodeset"
to /etc/default/grub and run
update-grub

Phil.
Just try, and it's not doing the job, the proxmox server still don't wanna start after this update without the graphic card
 
Just try, and it's not doing the job, the proxmox server still don't wanna start after this update without the graphic card
depending on the card, how the kernel is built, etc. you might not be loading the right driver modules. they could be blacklisted by pve already or just havent been configured to load automatically on boot. or, if youre trying to do it without a graphics card and only access it remotely, then it could be that grub is grabbing the framebuffer / console in anticipation of a GPU driver being loaded.
when you say "dont wanna start" it would be helpful to have more details. like system specifications, proxmox version installed, also reverting back to the last known working configuration and changing one thing at a time until you find which thing is causing the problem.
Knowing what you have, what you've done, and what you want to do, will help whoever reads this and wants to help you.
also I would make a new post specifically for your issue. (search the forums for similar issues first though, someone may have already solved it)
 

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!