OSM Documentation 0.1.0 Search

7. Virtual machines

Install Virtual Machines from the App Catalog. It runs virtual machines with KVM, the hypervisor built into Linux. To run them at full speed, the processor needs VT-x or AMD-V, turned on in the computer's firmware (Hardware). Without it, virtual machines still run, but very slowly.

Creating a virtual machine

Virtual Machines > Create... offers three ways:

  • A ready-made system: Debian, Ubuntu or AlmaLinux, ready in one click, with no installer to go through and an account made for you. The image comes from its publisher, checked against the publisher's own checksums, and is kept for the next virtual machine, which can then be made without the internet. Its disk is at least as large as the publisher's image (OSM says so if the size chosen is smaller). OSM makes the account's password: it is shown when the virtual machine is made, and again with Account... in its More menu.
  • A virtual machine: Windows, Linux or anything else, from its installer ISO. Put the ISO file in the shared folder iso first (the Administrators may write there, with Files or from a computer over the network), or in any other shared folder, then choose it here.
  • OSM: to try OSM in OSM, started from OSM's installer. Put OSM's USB image or ISO in a shared folder with Files first.

Then choose:

  • the processors, memory and disk size (the disk is a file on a volume, which grows as it is used). OSM keeps an eighth of the server's memory, 2 GB at least and 8 GB at most, for itself and its apps: a virtual machine starts only when its memory fits beside the ones running, and the page shows how much is free for virtual machines;
  • the network: on the server's bridge, the virtual machine gets its own address from your router, like any computer; on NAT, it reaches the network through the server and is hidden behind it;
  • UEFI with Secure Boot, and a TPM 2.0 (needed by Windows 11).

Using a virtual machine

  • Connect opens the screen of a running virtual machine in a window of the desktop, with its keyboard and mouse.
  • Paste text... on the screen types a text into the virtual machine for you, key by key, as if on its keyboard: a command, a product key, a few lines of a script (5,000 characters at most). It works everywhere a keyboard does, in an installer or at a sign-in too. Choose the keyboard layout the virtual machine is set to: English (US), English (UK), German or French (each VM remembers its choice, and one you have not chosen for yet offers the last layout you chose). Before it types, OSM tells you the characters that layout cannot type, for example an é with the English ones. Each line break presses Enter; Stop typing stops it. Copying text out of a virtual machine is not possible this way.
  • Shut down asks the system inside to shut down; Force stop is like pulling the plug; Pause and Resume freeze and continue it.
  • Settings... changes its priority, whether it starts with the server, the ISO in its CD drive and, while it is shut down, its processors and memory. Its disks and network stay as they were made.
  • To take the ISO out once the system is installed, choose (empty) for CD / ISO in Settings.... An OSM virtual machine started from OSM's USB image has Remove the installer... in its More menu instead.
  • Delete... removes the virtual machine and its disk files, unless you tick Keep its disk files. Its backups stay (below).

Priority and start order

Like apps, each virtual machine has a Priority: Critical, High, Normal or Low, for the processor and the disks when the server is busy. When the server starts, the virtual machines that start with it come up in order of priority, Critical first. One that cannot start then (not enough memory, for example) is a notification that says why.

Devices

PCI and USB devices... gives a device of the server to one virtual machine: a USB stick or dongle, a graphics card, a network card, a disk controller.

  • PCI devices need the IOMMU (VT-d or AMD-Vi) turned on in the firmware; OSM then turns it on in Linux with one switch, which takes a restart. A device is given with the other devices of its IOMMU group, which Settings > System Info > Hardware lists; the group of the chipset itself cannot be given away.
  • PCI devices are added and removed only while the virtual machine is shut down; USB devices also while it runs.
  • A device the server uses itself is marked The server uses it. To give it away anyway, you tick I understand, and want it anyway: the server can lose its disks, its network or its screen.
  • While the virtual machine runs, the device belongs to it alone; it comes back to the server afterwards.

Protecting a virtual machine's data

A virtual machine's disks are files in a system folder of a volume, so the volume's RAID protects them from a failed disk. Against the rest (a system that no longer starts, files deleted or encrypted in it, an update gone wrong), OSM backs virtual machines up from the outside, with nothing to install in them:

  1. In Virtual Machines, choose More > Backups... of the virtual machine, then Settings....
  2. Tick Back this virtual machine up, and choose the volume to keep its versions on, when (every day or every week at an hour, or by hand) and which versions to keep, as for backup tasks: one a day for so many days, one a week, one a month, one a year. The newest version always stays.
  3. Back up now makes a version at once.
  • A running virtual machine runs on during its backup. Its first version holds every block of its disks; each next one holds only the blocks written since, so it is quick and small. With QEMU's guest agent in it (qemu-guest-agent in Linux, which the ready-made systems have; the virtio-win guest tools in Windows), its file systems are frozen for a moment as the backup starts, and the version is consistent: as after a clean shutdown. Without one, a version is as after a power cut, and the list of versions says so.
  • A virtual machine that is shut down has its disks copied whole, and cannot start until the copy is done. One that has not run since its last version gets no new one.
  • The versions are kept in a system folder of the volume (@vmbackup) that only the server reads, never in a shared folder. They hold the disks and the virtual machine's settings, not its TPM.

Each version has Restore:

  • As a new virtual machine...: a new virtual machine beside the old one, with its own disks, new network addresses (MAC), no PCI or USB device and an empty CD drive. It is not started: both have the same system inside, so start it once the old one is off, or change its network first. It has a new TPM: a Windows with BitLocker asks once for its recovery key.
  • A disk back into...: only while the virtual machine is shut down. The disk becomes as it was in the version, and what was written on it since is lost. The disk stays as it is until the version's copy is ready.
  • Files...: choose the disk and its file system (ext4, XFS, Btrfs, NTFS or FAT), open its folders, tick what to restore and choose a shared folder: OSM makes a new folder Restore name date in it and copies them there. Links and special files stay behind. For a disk with LVM or encryption, restore the version as a new virtual machine and copy the files from inside it.
  • Delete this version...: the next version first takes in what it needs from it.

The backups of a virtual machine you delete stay: Backups of deleted VMs... above the list opens them, to restore a version as a new virtual machine, take files out of it, or delete them. A backup that fails is a notification with the reason.