VirtualMachineConfig document. Talos uses libvirt and QEMU to create the virtual machine, maintain its desired state, and report its current state in a VirtualMachineStatus resource.
This page runs Talos Linux as the guest. It downloads a Talos Linux ISO, creates a content library, uploads the ISO to it, declares a virtual machine that boots from the ISO, and connects to the guest with talosctl. Booted from the ISO, Talos Linux starts in maintenance mode and runs from memory, so the virtual machine needs no disk of its own.
Before you begin
The steps on this page require:- A host set up as described in Install a hypervisor host, which meets the requirements.
-
talosctlconfigured with the Admin role for the host. -
The host’s IP address. The commands on this page use the
HOST_IPvariable, which holds the IP address of the host that runs the virtual machine. To set the variable, replace<host-ip>with the host’s IP address and run: -
jq, to build the ISO with the Image Factory API on an amd64 cloud host. -
The name of the host Ethernet link that the virtual machine attaches to. To list the links on the host, run:
The output lists every link on the host. Choose the link that connects the host to the network the virtual machine should join. The right link has:
OPER STATEset toupandLINK STATEset totrue.- An empty
KINDcolumn, which marks a physical network port. A link of kindbondorvlanalso works.
macvtap. Eachmacvtaplink belongs to a virtual machine that is already running. Save the link name from theIDcolumn in a variable, replacing<link-name>with the name, such asenp1s0: - A DHCP server on the network that link is connected to, so the virtual machine receives an IP address. A guest on a cloud host, which is checked through its serial console, does not need one.
libvirtd extension runs the ext-virtqemud service, which Talos uses to start virtual machines.
To check that the service is running, run:
ext-virtqemud with the state Running. If the service is missing or not running, see Install a hypervisor host.
Step 1: Download the Talos Linux ISO
The guest boots from a Talos Linuxmetal ISO with no system extensions. The ISO must match the host’s processor architecture.
Save the Talos Linux version and the host’s architecture in variables, replacing <talos-version> with the Talos Linux version and <arch> with amd64 or arm64:
If the host is itself a virtual machine, for example on Proxmox, the choice depends on its hypervisor. If that hypervisor passes traffic from the guest’s MAC address, use the Bare Metal Host tabs. Otherwise, use the Cloud Host tabs.
- Bare Metal Host or arm64 Cloud Host
- amd64 Cloud Host
This ISO is for bare-metal hosts and arm64 cloud hosts. The arm64 ISO already writes to the serial console, so a cloud host needs no changes to it. It is built from the default Image Factory schematic, which has no customizations and the ID
376567988ad370138ad8b2698212367b8edcb69b5fd68c80be1f2ec7d603b4ba.Download the ISO for the default schematic:Step 2: Create a content library
A content library stores the images that virtual machines boot from and is kept on a Talos volume. The following steps declare a content library, apply it to the host, and check that it is ready.-
Run the following command to create
content-library.yaml, which declares a directory volume and a content library backed by it:A directory volume is a directory on the host’sEPHEMERALvolume, so it does not need a disk of its own. Thebacking.volumefield names the volume by the name declared in itsUserVolumeConfigdocument. -
Apply the documents to the host:
Talos mounts the volume and reports the library’s state in a
ContentLibraryStatusresource. -
Confirm that the library is ready:
The
PHASEcolumn showsreadyonce the library can accept uploads.
Step 3: Upload the ISO
Files are added to a content library over the Talos API. The following steps upload the ISO to theimages library and check that it is there.
-
Upload the Talos Linux ISO to the
imageslibrary:The file keeps its own name in the library. To store it under a different name, add--name <name>. To have the host verify the upload, add--digest sha256:<checksum>; the host refuses the upload unless the contents match. -
Confirm that the file is in the library:
Step 4: Declare the virtual machine
The virtual machine boots with BIOS firmware on amd64 and UEFI firmware on arm64. On a cloud host, it also needs its serial console enabled, because the guest is checked through the serial console instead of over the network. The following steps declare the virtual machine and apply it to the host.-
Save the firmware type in a variable, replacing
<firmware>withbioson an amd64 host oruefion an arm64 host: -
Choose a MAC address for the virtual machine and save it in a variable. Replace
<mac-address>with an address that no other device on the network uses, such as52:54:00:00:00:01:Talos shows a guest’s IP address only when the guest runs the QEMU guest agent, which the Talos Linux ISO does not include. A known MAC address makes the IP address easy to find in the DHCP server’s leases in Step 6. -
Run the following command to create
vm.yaml, which declares a virtual machine that boots from the ISO:This document gives the virtual machine two virtual CPUs and 2 GiB of memory, the minimum for a Talos Linux control plane node. Thedisksentry attaches the ISO from theimageslibrary as a read-only CD-ROM and boots from it first. The network interface attaches the guest to the host link named inlink, where it appears as a separate machine on that network. ThehardwareAddrfield gives the guest the MAC address fromMAC_ADDRESS. Without it, Talos derives an address from the virtual machine and interface names. -
Apply the virtual machine to the host, following the tab for the host’s environment:
- Bare Metal Host
- Cloud Host
Applyvm.yamlto the host:
Step 5: Check the virtual machine’s status
Talos starts the virtual machine and reports what it observes in aVirtualMachineStatus resource.
To see the virtual machine’s status, run:
STAGE column shows how far the virtual machine has progressed toward its declared state:
unknownmeans Talos has not observed the virtual machine yet.pendingmeans Talos is still bringing the virtual machine up, or is waiting for something on the host, such as the link named inlink.readymeans the observed power state matches the declaredrunningstate, which thePOWERcolumn also shows.errormeans something prevents the declaration from being met.
ERROR column says so. For example, a link name that does not exist on the host keeps the virtual machine at pending, and the ERROR column names the missing link.
Step 6: Connect to Talos Linux in the virtual machine
The guest boots Talos Linux into maintenance mode. On a bare-metal host, the guest is reached over the network. On a cloud host, it is checked through its serial console.- Bare Metal Host
- Cloud Host
The guest gets its IP address from the DHCP server. Talos does not report this address, because the Talos Linux ISO does not include the QEMU guest agent.The following steps find the guest’s IP address and connect to it.
-
Find the guest’s IP address by the MAC address in
MAC_ADDRESS, in one of these places:- On the DHCP server, usually the router, open its list of DHCP clients or connected devices and find the MAC address.
- From another Linux machine on the same network, run
ip neigh | grep -i "$MAC_ADDRESS". A machine lists only the devices it has recently exchanged traffic with, so if the guest does not appear, scan the network first, for example withnmap -sn 192.168.1.0/24using your network’s address range.
-
Save the guest’s IP address in a variable, replacing
<vm-ip>with the address: -
From another machine on the network, confirm that Talos Linux is running in the virtual machine:
The output lists the virtual machine’s processors, with the manufacturer
QEMU. The guest is now a Talos Linux machine waiting for a machine configuration, the same as a physical server booted from the ISO. The command runs from another machine because the guest is attached to the host link through macvtap, so the host cannot reach the guest through its own address on that link. The--insecureflag works because in maintenance mode, the Talos API accepts unauthenticated requests.
Step 7: Clean up
To remove the virtual machine, its document is deleted from the machine configuration. Talos then powers off the virtual machine and removes it from libvirt. The host refuses to delete a file that a virtual machine still uses, so the ISO is deleted only after the virtual machine is gone. The following steps remove the virtual machine and then the ISO.-
Run the following command to create
vm-delete.yaml, a patch that deletes thetalos-guestdocument: -
Apply it to the host:
-
Confirm that
talos-guestno longer appears in the virtual machines that libvirt reports: -
Delete the ISO from the library:
If the host still reports the file as in use, retry after a few seconds.
Next steps
The following pages cover the rest of working with virtual machines:- To configure a virtual machine’s processors, memory, firmware, disks, console, and network interfaces, see Configure a virtual machine.
- To upload, list, replace, and delete images in a content library, see Upload and manage images.
- To attach to a virtual machine’s serial console or read its output, see Access the virtual machine console.