Skip to content

Disposable Linux Mint VM and USB File Transfer

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.

  • 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.

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.

Terminal window
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:

Terminal window
lsmod | grep kvm

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

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

Terminal window
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 XFCE ISO to a local ISO folder on the host.

Terminal window
mkdir -p ~/ISO
cd ~/ISO
wget https://mirrors.edge.kernel.org/linuxmint/stable/22.1/linuxmint-22.1-xfce-64bit.iso

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

Terminal window
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.

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:

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

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

Terminal window
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.

Terminal window
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.

Terminal window
lsblk -f

Expected: sda1 with FSTYPE exfat and LABEL USBTRANSFER.

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

Terminal window
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:

Terminal window
dolphin /mnt/usb

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

Terminal window
sync
sudo umount /mnt/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:
Terminal window
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:
Terminal window
sudo mount -o uid=$(id -u),gid=$(id -g),umask=022 /dev/sda1 /mnt/usb
dolphin /mnt/usb
  • Final safe unmount:
Terminal window
sync
sudo umount /mnt/usb

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

Terminal window
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.