A guide for the deployment of Debian virtual machines with Proxmox
This is third part in my homelab infrastructure rebuild project, Homelab Infrastructure Rebuild Overview. This guide assumes you have a Proxmox instance running with OPNsense. See Migrating to Proxmox for Proxmox installation and configuration instructions, and OPNsense Firewall Deployment, Configuration, and Segmentation with Proxmox for the OPNsense configuration. I use Debian for my Docker hosts, and highly recommend it for its stability, light resource usage, and lack of bloat. I will discuss the configuration of Docker on Debian in a future guide. While this guide is written primarily for Debian as a Docker host, the Proxmox deployment portion of this guide is highly transferable to other Linux distros.
Adding the Debian ISO to Proxmox
We need to add a Debian ISO to deploy from to Proxmox. To do this, download the ISO file to your work computer. Then navigate to your Proxmox management GUI:
- Navigate to
<your-proxmox-node>| local (<your-proxmox-node>) | ISO Images - Click Upload
- Alternatively click Download from URL if you have an ISO download URL
- Click Select File
- Select
<your-debian-iso> - Click Upload
Deploying the Debian VM
- Click Create VM
- Configure to the table:
| Option | Setting | Section | Note |
|---|---|---|---|
| Node | <your-proxmox-node> | General | |
| VM ID | <your-vm-id> | Can be any number. I deploy each VM id with an increment of 10. So if you have a VM of ID 100, do 110. Then 120 for the next VM you deploy | |
| Name | <your-vm-name> | I name each vm after its purpose. If this is a VM for the DMZ, I would call it dmz | |
| Start at boot (Advanced) | Yes | Optional, but if you’re using this to host you probably want it to start at boot | |
| Start/Shutdown order (Advanced) | Any | ||
| Use CD/DVD disc image file | Yes | OS | |
| Storage | local | ||
| ISO image | <your-debian-iso> | ||
| Guest OS Type | Linux | ||
| Graphic card | Default | System | |
| Machine | q35 | ||
| BIOS | OVMF (UEFI) | UEFI allows iGPU passthrough | |
| SCSI controller | VirtIO SCSI Single | ||
| Qemu Agent | Yes | Optional but highly recommended agent for Proxmox | |
| Add TPM | No | ||
| Bus/Device | SCSI | Disks | |
| Storage | local-lvm | ||
| Disk size | 64 GB | Can be whatever size you want, I recommend at least 64GB for a Docker host | |
| Cache | Default | ||
| Discard | Yes | ||
| IO thread | Yes | ||
| Sockets | 1 | CPU | |
| Cores | 4 | Choose what you feel you need, I recommend 4 cores for a Docker host | |
| Type | host | ||
| Memory | 8192MB | Memory | Can be whatever size you want, I recommend 8GB for a Docker host |
| Ballooning Device (Advanced) | No | ||
| Bridge | vmbr1 | Network | |
| VLAN Tag | <your-vlan-tag> | Choose the appropriate VLAN tag for the subnet you are deploying this on | |
| Firewall | No | ||
| Model | VirtIO | ||
| MAC Address | Leave blank | ||
| 3. Click Finish |
Debian VM Installation
The rest of this guide requires your VM to have internet access. If you are following my guides currently, your VM will not have internet access. The next guide I post will contain an in-depth look at OPNsense firewall rule configuration. In the meantime, navigate to OPNsense and do the following to allow internet access while keeping the segmentation:
- Navigate to Firewall | Aliases
- Click +
- Configure to the table
| Enabled | Name | Type | Categories | Content | Statistics | Description |
|---|---|---|---|---|---|---|
| Yes | RFC1918 | Network(s) | Leave blank | 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 | No | RFC1918 grouping |
- Click Save
- Click Apply
- Navigate to Firewall | Rules
- Click +
- Configure according to the table:
| Enabled | Categories | Description | Invert Interface | Interface | Quick | Action | Direction | Version | Protocol | Invert Source | Source | Source Port | Invert Destination | Destination | Destination Port | Log | Gateway |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Yes | Leave blank | <your-machine> Internet Only | No | <your-vlan-interface> | Yes | Pass | In | IPv4 | Any | No | <your-vlan-interface> Network | Any | Yes | RFC1918 Alias | Any | Yes | None |
- Click Save
- Click Apply
We now want to install and configure Debian. To do so access your Proxmox management GUI:
- Navigate to
<your-proxmox-node|<your-deployed-debian-vm>| Console - Click Start Now
- Select Graphical install
- Press Enter
- Select
<your-chosen-language> - Click Continue
- select
<your-country> - click Continue
- select
<your-keyboard-layout> - click Continue | Continue
- Select Configure network manually
- Click Continue
- Enter
<your-machine-ip>/24- For the first 3 octets of the IP, use the subnet that your assigned VLAN uses, and for the last octet choose a number under 255. For example, if your VLAN 40 uses the 10.0.40.0/24 subnet, you can use 10.0.40.10/24.
- Enter
<your-subnet-gateway-address>- For this step and the following, it is typically going to be the first address of your subnet. For example, if you’re using the 10.0.40.0/24 subnet, 10.0.40.1 is what you would put here.
- Enter
<your-subnet-gateway-address> - Enter
<your-hostname>- Typically the same as what you named your VM
- Enter
<your-home-domain> - Click Continue
- Skip setting up the root account here
- Enter
<your-name> - Enter
<your-username> - Type
<your-password>in both boxes - Click Continue
- Select
<your-timezone> - Click Continue
- Select Guided - use entire disk
- Click Continue
- Select
<your-disk> - Click Continue
- Select All files in one partition
- Click Continue | Continue
- Select Yes
- Click Continue
- Select No
- Click Continue
- Select
<your-country> - Click Continue
- Select deb.debian.org
- Click Continue | Continue
- Select No
- Click Continue
- Untick GNOME
- Untick Debian Desktop Environment
- Tick SSH server
- Tick standard system utilities
- Click Continue | Continue
Now you should have a working Debian VM. You’ll also want to unmount the iso in Proxmox:
- Navigate to
<your-proxmox-node|<your-deployed-debian-vm>| Hardware - Select CD/DVD Drive
- Click Edit
- Tick Do not use any media
- Click OK
Debian VM configuration
Lastly, we want to install some basic things and ensure our Debian is up to date. We’ll be installing and configuring the qemu guest agent, the purpose of which is explained here, curl for downloads, as well as ca-certificates which allows for https downloads. In Proxmox:
- Navigate to
<your-proxmox-node|<your-deployed-debian-vm>| Console - Login with your username and password
- Enter the following command:
- This may require a VM restart, do so, and then repeat steps 1 and 2 and move to step 4
sudo apt update && sudo apt full-upgrade -y
- Enter the following command
sudo apt install -y qemu-guest-agent curl ca-certificates
Now you have deployed Debian VM that is ready to serve as a docker host, or any other type of host.
Closing Notes
Now that you have a Debian VM setup, we’ll need to get firewall rules configured for it so it can securely provide services, like SSH. My next guide will cover OPNsense firewall rules in depth, with an explanation on how to write your own as well as some recommended rules.