My Ultimate Home Server/Workstation
Dec. 4, 2021 MiscMy Ultimate Home Server Workstation
My notes on installing Proxmox as a home-lab server
Table of Contents
I was looking for a good hypervisor for my home server the other day. There are a plethora of free/open source choices which meet most of my criteria except one: I want to be able to use the same machine as a workstation so that for a simple web browsing, etc. I don't need to turn on my laptop or let it run overnight if I am running a long process. This is my experience on setting up such a machine.
Requirements
- Have a desktop UI to allow me to work on the same computer
- Allow me to encrypt my personal data
- Virtualization to install any OS that I'd need
- Option to use USB SSD as a boot device for virtual machines
- UEFI support
Proxmox has it all
Given the software requirements, I found Proxmox to accommodate all my needs. Along with SPICE, it also support a fast interaction on VM (virtual machines)
Installation and setting up
For Proxmox, there are two installation options, offering desktop environments on top; one is to install Debian and then install Proxmox on top, the other is to install Proxmox directly and install DE on top. The first option did not work for me since I was not able to switch from Debian kernel to Proxmox kernel. The latter installation is very straight forward, copy the ISO to a USB stick with gnome-disks and boot from it. I then proceeded with the following for setting it up the way I want:
Install gnome-desktop
To install gnome-desktop (from Debian sources, for gnome-desktop 40 see later sections), taken from Proxmox website - Developer Workstations with Proxmox VE
apt-get update && apt-get dist-upgrade apt-get install task-gnome-desktop firefox
Add new user for the desktop environment
adduser <user>
usermod -aG root <user>
usermod -aG sudo <user>
Make the user a Proxmox admin
pveum user list
pveum group list
pveum acl list
pveum group add admin -comment "System Administrators"
pveum acl modify / -group admin -role Administrator
pveum user modify <user>@pam -group admin
pveum user modify <user>@pam -group admin
Add USB bootable devices
I struggled with this for a while since my USB SSD uses luks full-disk encryption and could not find all the crypt volumes after decryption if I added it as a normal disk. Nevertheless, I put it here maybe it is useful to someone, including my future self.
As a host hardware passthrough
This is the path I had taken leading to the mentioned struggle, taken from Proxmox website - Passthrough Physical Disk to Virtual Machine (VM):
# Figure which device should be passed through sudo ls -l /dev/disk/by-id/ # And manually add it to the previously-created VM sudo qm set <VM-ID> -scsi1 /dev/disk/by-id/<disk-id>
then change the BIOS to OVMF (UEFI) in the hardware section for the VM on Proxmox panel. This led to the following error for me after the device decryption and grub screen:
ERROR: device '<dev>' not found. Skipping fsck. :: mounting '<dev>' on real root mount: /new_root: no filesystem type specified. You are now being dropped into an emergency shell. sh: can't access tty; job control turned off [rootfs ]#
As a host USB device passed through to the VM
This one is what worked for me finally and removed the above error when booting.
- Proxmox panel > Hardware
- Add > USB device
Use USB Vendor/Device ID
- Select your SSD
- Make sure SSD is not mounted and run the machine
Add hot pluggable USB support
Sometimes I need to pass through my external hard disk or other USB devices when the machine is running. This is not possible using the normal Hardware section interactions as it needs a restart when a USB device is added. The solution is to use SPICE USB channels for USB devices. To use this, do the following:
- Proxmox panel > Hardware
- Add > USB device
Spice Port
- Restart the machine (only once)
- Start the SPICE console from the top menu (if this is disabled for you, see next sections)
- In the new (
virt-manager
) window click File > USB device connection - Select your device and let it be mounted to the machine
This allows plugging and unplugging from the guest without a need to reboot.
Add some SPICE to the server
noVNC works alright out of the box if you don't need a high display refresh rate and other SPICE features. However, if you want to use your VM with a better UI experience, SPICE is there for you. Installing a SPICE client is as simple as sudo apt install virt-viewer
. Then it can be enabled for in the Hardware section of the VM by setting the display to SPICE and increasing the memory to 64 MiB at least. The same can be done for audio device, too. Folder sharing and video streaming enhancements can also be in the Options section, allowing a better performance and access to folders. Full instructions can be seen in Proxmox page - Requirements for SPICE and SPICE website - User manual.
Install Gnome Desktop 40
The Gnome Desktop 40 is available in testing
sources for Debian, to enable it, add the following to your /etc/apt/sources.list
:
/etc/apt/sources.list
and install using:
sudo apt update sudo apt -t testing install gnome-shell gnome-backgrounds gnome-applets gnome-control-center mutter gjs gnome-tweaks
Date: 2021-12-04 Sa 00:00