Recently I decided to spend a little time working on virtualisation. I don’t mean to say that I’m trying to make myself disappear from reality… but I did want a setup that more closely matched my production environment so that I can do more testing before uploading to my hosted servers.
I had an old Dell Latitude E7250 laptop that wasn’t being used so I decided to install Proxmox on it to try out virtualising my staging environment. Proxmox Virtual Environment is an open source server virtualisation management solution and is usually installed on servers or dedicated desktops. However, I didn’t have a desktop at home and wanted to try Proxmox out before buying anything. Hence the decision to install Proxmox on a laptop.
There are few things to consider when installing on a laptop. Proxmox is usually run on a “headless” server, in other words a server without a monitor. It is usually accessed by a web management interface from another device. This posed a problem when running Proxmox on the laptop as it never powered down the laptop’s screen. It also posed a problem when sleeping when the laptop’s lid was closed. We’ll address both of those issues below.
Before you start
It goes without saying that when you install Proxmox it will wipe anything on the laptop’s boot disk. So backup anything that you may need before you start!
The next step is to prepare your network. In my router’s settings I gave my laptop a fixed IP address in the DHCP server options using the laptop’s MAC address. I also took this opportunity to use a domain name for my LAN. After a lot of reading I decided to use int.mydomain.com (for a domain that I own) instead of using a made-up name like mydomain.local . It seems that .local extensions may give issues with Apple devices. The “int” in the name refers to “internal” so that it won’t clash with any machines hosted externally for that domain. Now I can access any of my devices within my network using names such as mycomputer.int.mydomain.com instead of remembering IP addresses.
Another thing to consider is that Proxmox requires a wired network (not wifi). My Dell Latitude laptop has a built in ethernet port so that’s the way I’ll connect it to the network.
Create a boot USB and install Proxmox
Now it’s just a simple task of going to the Proxmox website to download the installation iso. Using Rufus you can create a bootable USB drive with that iso. I did face a few challenges getting the Dell laptop to boot from the USB drive. In the end I had to change the Bios bootup options to UEFI instead of Legacy. Once this was done then the laptop booted into the Proxmox installation wizard and it was a straight-forward process of following the installation steps. This was where I entered in the fixed IP address and network domain name that I had configured in my router beforehand.
I then followed the instructions from Serve The Home to update Proxmox without a subscription.
Prevent the laptop from sleeping when closing the lid
Finally we’re at the section where we need to make changes specifically as we are using a laptop. Proxmox provides a web interface for creating and managing your VMs. So by default you don’t need to use the laptop’s screen, you’ll need to access the web interface from another device. If you’re using a server or a desktop with a separate monitor you can just unplug the screen or switch it off. However, you can’t do that with the laptop’s screen.
The first step is to stop the laptop from sleeping when closing the lid. To do this we need to add in a couple of lines into the logind.conf file.
1. In the web interface click on your node and then go to the “Shell” tab.
2. Edit /etc/systemd/logind.conf (I use the vi editor so I just typed “vi /etc/systemd/logind.conf”).
Add in the following 2 lines in the file (use “i” key to get into “insert” mode to start typing in vi):
3. Save the file and exit (ESC then “:wq”).
4. And finally restart the service by typing the following at the Shell command point:
systemctl restart systemd-logind.service
Now we can happily close the laptop’s lid and the laptop will not go to sleep. However, I did notice that the screen remained switched on even when the lid was shut. Which reminded me to check whether the fridge light goes off when you close the door…
Switch off the screen after 5 min
The next thing we’ll need to change is to switch off the screen (regardless of whether the lid is open or closed). Eventually I found the following instructions which I’ll repeat here.
1. Go to the Shell tab of your node (as above).
2. Edit /etc/default/grub (“vi /etc/default/grub”).
Change the following line to read:
The “300” is the number of seconds before the screen goes to sleep. I chose 300 seconds (5 minutes).
3. Save the file and exit (ESC then “:wq”).
4. Then restart so that it sets it in place by typing the following in the Shell:
That’s it! Installed Proxmox on your laptop
And that’s all there is to it! Now we have the Proxmox virtualisation environment installed and running on our laptop ready to host our virtual machines.