Skip to content

Installing Ubuntu Server 26.04 LTS

This guide describes how to install and prepare Ubuntu Server 26.04 LTS as a virtual desktop in IsardVDI and optimize it for a virtualization environment.

Unlike the Ubuntu Desktop 26.04 LTS guide, all configuration here is done from the terminal: servers have no graphical environment, so the GNOME/GTK optimizations and the remote desktop (RDP) configuration do not apply.

Recommendation: access it through the bastion

To work with a server, the best option is to connect to it over SSH through the bastion, which gives access to the machine through the installation's HTTPS port (443 by default) without having to set up a VPN. The SPICE and VNC in browser viewers are kept for the installation and for troubleshooting boot problems. See section 8, «Access through the bastion».

Parameter Value
vCPUs 2
Memory (GB) 4
Disk size (GB) 100
Networks Default, Wireguard VPN
Boot CD/DVD
Videos Default
Operating system template Ubuntu 24.10 (non-LTS)

Operating system template

Until there is a specific template for Ubuntu 26.04, use the Ubuntu 24.10 (non-LTS) template. The "Ubuntu 24.10 LTS" variant causes a kernel error during boot.

The resources in the table are a starting point: adjust them to the services the server must run.

2. Creating the VM in IsardVDI

  1. Upload the Ubuntu Server 26.04 LTS ISO to Media (see Media).

  2. In Media, find the ISO and click Create new desktop.

  3. In the Operating system template field, choose the template given in the previous table.
  4. Configure the remaining parameters (vCPUs, memory, disk and networks) and check that Boot is CD/DVD.
  5. Click Create desktop and start it with the SPICE or VNC in browser viewer.

3. Installing Ubuntu Server

The Ubuntu Server installer is text-based and is navigated using the keyboard (+tab+, arrow keys, and +enter+).

  1. Select the language and keyboard layout.
  2. Installation type: Ubuntu Server (not the minimized version, which does not include the usual administration tools).
  3. Network: let the interfaces obtain their address via DHCP. The first one corresponds to the Default network and the second one to Wireguard VPN.
  4. Proxy and APT mirror: leave the default values.
  5. Storage: use the entire disk. If LVM is not required, uncheck its use to simplify later disk expansion.
  6. Profile: define the username, server name, and password.

    Credential match

    The username and password must match the desktop credentials defined in IsardVDI. Otherwise, SSH access through the bastion will not be possible.

  7. Ubuntu Pro: skip this step.

  8. OpenSSH: check Install OpenSSH server. It is essential for the bastion.
  9. Featured Snaps: do not select any.
  10. Wait for the installation to finish and select Reboot Now when prompted.

4. Modifying the Desktop XML

In IsardVDI, edit the desktop XML and add the following <driver> attribute inside the <disk> element:

<driver name="qemu" type="qcow2" cache="unsafe" discard="unmap"/>

This enables discard=unmap (required for TRIM to take effect on the storage) and cache=unsafe (faster for desktops that do not need persistence after a host failure).

Roles with XML access

Editing the desktop XML is only available to the administrator role.

5. Shut down and change boot to hard disk

  1. Shut down the VM with Stop. If it gets stuck shutting down, click Force stop.
  2. In the desktop edit form in IsardVDI:
    • Remove the CD/DVD media.
    • Change Boot from CD/DVD to Hard Disk.
    • Click Save changes.
  3. Start the VM again.

6. Post-installation configuration

6.1 System update and package installation

sudo apt update
sudo apt upgrade -y
sudo apt install -y vim net-tools htop curl wget \
    qemu-guest-agent openssh-server nmap traceroute tree

sudo systemctl enable --now qemu-guest-agent
sudo systemctl enable --now ssh

No graphical packages

spice-vdagent, mesa-utils, and xrdp are not installed: they only make sense on a desktop with a graphical environment.

6.2 Optimizing /etc/fstab

Add the noatime,discard options to all ext4 partitions to reduce disk writes and enable real-time TRIM:

# /etc/fstab — example
UUID=xxxxx-xxxxx-xxxxxx /    ext4    defaults,noatime,discard,errors=remount-ro 0 1

6.3 Reducing log storage

Edit /etc/systemd/journald.conf (or a file inside /etc/systemd/journald.conf.d/) and set:

[Journal]
SystemMaxUse=20M
SystemKeepFree=4G

6.4 Removing Snap

Snap keeps its own background update service and takes up space with old revisions. On a server it is preferable to install software from APT:

# Check which snaps are installed
snap list

# Remove them (order matters: applications first, then bases)
sudo snap remove --purge <snap_name>

sudo systemctl stop snapd.socket snapd.service

sudo apt-get purge -y snapd
sudo rm -rf /var/cache/snapd /root/snap /var/snap ~/snap /snap

sudo su
printf 'Package: snapd\nPin: release a=*\nPin-Priority: -10\n' \
    > /etc/apt/preferences.d/no-snap
exit

Check dependencies first

If the server uses a service distributed as a snap (for example lxd or certbot), reinstall it from APT or keep snapd on this machine.

6.5 Disabling swap and switching to periodic TRIM

sudo systemctl enable --now fstrim.timer

sudo systemctl mask swap.img.swap

sudo sed -i.bak '/\bswap\b/ s/^\([^#]\)/#\1/' /etc/fstab

sudo rm -f /swap.img

sudo su
swapoff -a
echo 'vm.swappiness=0' > /etc/sysctl.d/99-isard-swap.conf
exit

sysctl --system
sudo systemctl restart systemd-sysctl.service
sudo systemctl status systemd-sysctl.service
  • fstrim.timer runs TRIM periodically instead of on every write.
  • Disabling swap is only advisable if enough memory has been assigned for the server's expected load.

6.6 Disabling automatic updates and their notifications

# Remove update-manager and notifiers
sudo apt purge -y update-manager update-notifier*

# Avoid development upgrades
echo 'Unattended-Upgrade::DevRelease "false";' | \
    sudo tee /etc/apt/apt.conf.d/50unattended-upgrades

# Block release upgrade
echo -e "[DEFAULT]\nPrompt=never" | \
    sudo tee /etc/update-manager/release-upgrades

# Disable APT automatic updates
sudo tee /etc/apt/apt.conf.d/20auto-upgrades > /dev/null <<'EOF'
APT::Periodic::Update-Package-Lists "0";
APT::Periodic::Unattended-Upgrade "0";
EOF

# Disable update services
sudo systemctl disable --now \
    unattended-upgrades.service \
    apt-daily.timer \
    apt-daily-upgrade.timer \
    apt-daily.service \
    apt-daily-upgrade.service \
    fwupd-refresh.timer \
    ModemManager.service \
    packagekit.service \
    motd-news.timer 2>/dev/null

# Block them completely
sudo systemctl mask \
    unattended-upgrades.service \
    apt-daily.timer \
    apt-daily-upgrade.timer \
    fwupd-refresh.timer \
    ModemManager.service \
    packagekit.service \
    motd-news.timer 2>/dev/null

Security updates

By disabling unattended-upgrades, security updates become the responsibility of the server administrator: run sudo apt update && sudo apt upgrade periodically or update the template.

6.7 Network configuration

The installer saves the configuration to /etc/netplan/50-cloud-init.yaml. Simplify it so that both interfaces obtain an IP via DHCP:

# /etc/netplan/50-cloud-init.yaml
network:
  version: 2
  renderer: networkd
  ethernets:
    enp1s0:
      dhcp4: true
      dhcp6: true
    enp2s0:
      dhcp4: true
      dhcp6: true

Apply it and check the result:

sudo chmod 600 /etc/netplan/50-cloud-init.yaml
sudo netplan apply
ip -brief address

Preventing cloud-init from overwriting the configuration

To prevent cloud-init from regenerating the file on every boot:

echo 'network: {config: disabled}' | \
    sudo tee /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg

7. System language

To set the system to English:

sudo dpkg-reconfigure locales
# Select en_US.UTF-8 UTF-8

8. Access through the bastion

Once the server is configured, the recommended way to access it is over SSH through the bastion, which publishes the machine through the installation's HTTPS port (443 by default) without having to connect to the WireGuard VPN first.

Requirements inside the VM:

  • Have the SSH server installed and active:

    sudo apt install -y openssh-server
    sudo systemctl enable --now ssh
    systemctl status ssh
    
  • The system user must match the desktop credentials defined in IsardVDI and belong to the administrators group (sudo). The bastion logs into the VM with these credentials; if the desktop has none, the connection is rejected.

Requirements on IsardVDI:

  1. Edit the virtual desktop and, in the Bastion section, turn on Enable bastion. If the desktop does not have the Wireguard VPN network, it is added automatically.
  2. Turn on Enable SSH access. It is off by default: without this step there is no SSH access.
  3. Have your own SSH public key in your user profile. The keys of other people who need access are added to the Authorized SSH Keys (one per line) field. They can be changed live, without stopping the desktop.
  4. Click Save changes.
  5. Connect from the host, using the desktop's bastion identifier as the user:

    ssh {UUID}@domain.com -p 443
    

Bastion documentation

Permissions, web service publishing and SSH key generation are described in the bastion guide.

9. Preparation for the template

Final step

These commands are executed just before permanently shutting down the machine to convert it into a template. If the desktop is started again afterwards, they must be repeated.

9.1 Clear the machine identifier

Clearing /etc/machine-id prevents all servers derived from the template from sharing the same identifier:

sudo truncate -s 0 /etc/machine-id
sudo rm -f /var/lib/dbus/machine-id

9.2 Delete the SSH host keys

If not deleted, all servers derived from the template will present the same SSH identity. They are automatically regenerated on the next boot:

sudo rm -f /etc/ssh/ssh_host_*

9.3 Clear the command history

# Clear the persistent history
echo "" | sudo tee ~/.bash_history
sudo su
history -c
exit
history -c