Ctrl K

Disposable Linux Mint VM and USB File Transfer

Create a throwaway Linux Mint XFCE virtual machine on an Arch host with virt-manager and KVM, then move files out of the guest using a writable exFAT USB drive redirected into the VM.

This page sets up a simple disposable Linux Mint XFCE virtual machine on an Arch host with virt-manager and KVM, then moves files out of the guest using a normal writable USB drive. The VM is meant to be temporary: keep work and data inside the VM, and transfer files out through USB only when needed. The host is Arch Linux, the guest is Linux Mint XFCE.

Overview

  • Install the virtualization stack on the Arch host and enable libvirt.
  • Start the default NAT network for guest internet access.
  • Download the Linux Mint XFCE ISO and create the VM in virt-manager.
  • Install Mint into the VM virtual disk, then eject the ISO.
  • Format a spare USB drive as exFAT on the host (this erases the USB).
  • Redirect the USB into the running VM, copy files out, then read them back on the host.

Host package setup

Install QEMU/KVM, libvirt, virt-manager, the OVMF firmware, swtpm, and the SPICE/USB redirection helpers. Then enable the libvirt daemon and add the current user to the libvirt group.

sudo pacman -Syu
sudo pacman -S qemu-full virt-manager virt-viewer libvirt dnsmasq edk2-ovmf swtpm spice-gtk usbredir

sudo systemctl enable --now libvirtd
sudo usermod -aG libvirt "$USER"

Log out and back in after the usermod for the group membership to take effect. Then verify KVM is available:

lsmod | grep kvm

Expected output is kvm_intel (Intel) or kvm_amd (AMD) alongside the kvm module.

Default NAT network

Start the default libvirt NAT network and set it to autostart so the guest gets an address and internet on every boot.

sudo virsh net-start default
sudo virsh net-autostart default
sudo virsh net-list --all

Expected: the default network listed as active with autostart yes.

Download the Linux Mint ISO

Download the Linux Mint XFCE ISO to a local ISO folder on the host.

mkdir -p ~/ISO
cd ~/ISO

wget https://mirrors.edge.kernel.org/linuxmint/stable/22.1/linuxmint-22.1-xfce-64bit.iso

Create the VM in virt-manager

Start virt-manager, then create the VM through the GUI.

virt-manager

Walk the New Virtual Machine wizard:

  • File -> New Virtual Machine.
  • Choose Local install media.
  • ISO: /home/YOUR_USERNAME/ISO/linuxmint-22.1-xfce-64bit.iso
  • OS detection: Linux Mint, or Ubuntu 24.04 if Mint is not listed.
  • Enable Customize configuration before install.

Recommended resources:

  • RAM: 4096 MB
  • CPUs: 2
  • Disk: 30 GB
  • Network: default NAT

Useful VM settings during customize:

  • Firmware: UEFI / OVMF if available
  • Disk bus: VirtIO
  • Network model: VirtIO
  • Display: Spice
  • Video: Virtio or QXL

Then choose Begin Installation.

Install Linux Mint

In the Mint installer:

  • Choose Install Linux Mint.
  • Choose Erase disk and install Linux Mint.

Note: "Erase disk" here means the VM virtual disk, not the Arch host disk.

After installation:

  • Reboot the VM.
  • If it boots back into the installer, shut the VM down and eject the ISO: VM Details -> CDROM -> disconnect or remove the ISO.

Optional cleanup on the host once the VM is installed:

rm -i ~/ISO/linuxmint-22.1-xfce-64bit.iso

Prepare the USB drive

Plug in the USB drive on the host and identify the device.

lsblk -f

The USB usually shows up as something like sda with a partition sda1, while the main system disk is usually nvme0n1. In the commands below the USB is assumed to be /dev/sda. Replace /dev/sda with your real USB device if it differs.

Warning: the next block erases the USB drive completely. Double check the device name before running it.

sudo umount /dev/sda* 2>/dev/null
sudo pacman -S exfatprogs
sudo wipefs -a /dev/sda
sudo parted /dev/sda --script mklabel gpt
sudo parted /dev/sda --script mkpart primary fat32 1MiB 100%
sudo partprobe /dev/sda
sudo mkfs.exfat -n USBTRANSFER /dev/sda1

Unplug and replug the USB, then verify the new exFAT partition.

lsblk -f

Expected: sda1 with FSTYPE exfat and LABEL USBTRANSFER.

Mount and test on the host

Mount the USB with your user as owner so you can write to it without sudo, then test write access.

sudo mkdir -p /mnt/usb
sudo mount -o uid=$(id -u),gid=$(id -g),umask=022 /dev/sda1 /mnt/usb

touch /mnt/usb/testfile
ls -l /mnt/usb

Open it in the file manager if desired:

dolphin /mnt/usb

When done using the USB on the host, flush and unmount it safely.

sync
sudo umount /mnt/usb

Transfer files from the VM to USB

The USB can only be attached to one side at a time. Free it on the host first, then redirect it into the guest.

  • Make sure the USB is not mounted on the host:
sudo umount /mnt/usb 2>/dev/null
  • Start the Linux Mint VM.
  • In the running VM window: Virtual Machine -> Redirect USB device, then select the USB drive.
  • Inside Mint, open the file manager. The USB appears as USBTRANSFER. Copy files from the VM onto it.
  • When finished, eject or unmount the USB from the Mint file manager.
  • Back on the host, unredirect the USB or unplug and replug it.
  • Mount it again on the host if needed:
sudo mount -o uid=$(id -u),gid=$(id -g),umask=022 /dev/sda1 /mnt/usb
dolphin /mnt/usb
  • Final safe unmount:
sync
sudo umount /mnt/usb

Daily usage summary

Start the VM with virt-manager and use it normally:

virt-manager

To move files out:

  • Unmount the USB from the host.
  • Redirect the USB into the VM.
  • Copy files inside Mint.
  • Eject the USB inside Mint.
  • Mount the USB again on the host.
  • Copy files from /mnt/usb.
  • Unmount the USB safely.

See also