Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sogaiu/a824178f1a2f62a6a77815c3693917ef to your computer and use it in GitHub Desktop.
Save sogaiu/a824178f1a2f62a6a77815c3693917ef to your computer and use it in GitHub Desktop.
linux mint 22.1 xfce installation notes (qemu vm)

Linux Mint 22.1 XFCE Installation for use with qemu VM

Some docs that might be handy:

Download iso for XFCE edition from mirror

$ aria2c https://ftp.kaist.ac.kr/linuxmint-iso/stable/22.1/linuxmint-22.1-xfce-64bit.iso

Verify sha256 Checksum

$ sha256sum linuxmint-22.1-xfce-64bit.iso 
6451496af35e6855ffe1454f061993ea9cb884d2b4bc8bf17e7d5925ae2ae86d  linuxmint-22.1-xfce-64bit.iso

Create VM Storage File

$ qemu-img create -f qcow2 linuxmint-22.1-xfce-64bit.qcow2 20G

Start VM via Shell Script

To start VM, execute following script or paste appropriate content into terminal.

#! /bin/sh

# adapted from:
#
#   https://www.baeldung.com/linux/qemu-from-terminal

qemu-system-x86_64 \
-enable-kvm                                                    \
-m 4G                                                          \
-smp 2                                                         \
-hda linuxmint-22.1-xfce-64bit.qcow2                           \
-boot d                                                        \
-cdrom linuxmint-22.1-xfce-64bit.iso                           \
-netdev user,id=net0,net=192.168.0.0/24,dhcpstart=192.168.0.9  \
-device virtio-net-pci,netdev=net0                             \
-vga qxl                                                       \
-device AC97

Follow Appropriate Steps to Install

  1. Choose the default start option at the "boot menu" and wait for graphical environment to finish starting

  2. Double click on "install linux mint", follow the prompts, and wait

  3. Shutdown VM

Prepare Shell Script for Ordinary Use

Create and use following shell script for subsequent boots (includes directory sharing)

#! /bin/sh

# adapted from:
#
#   https://www.baeldung.com/linux/qemu-from-terminal

qemu-system-x86_64 \
-enable-kvm                                                    \
-m 4G                                                          \
-smp 2                                                         \
-hda linuxmint-22.1-xfce-64bit.qcow2                           \
-netdev user,id=net0,net=192.168.0.0/24,dhcpstart=192.168.0.9  \
-device virtio-net-pci,netdev=net0                             \
-vga qxl                                                       \
-device AC97                                                   \
-virtfs local,path=shared,mount_tag=host0,security_model=mapped,id=host0

Finish Setup

  1. Boot vm using new shell script

  2. Log in

  3. Create following shell script for enabling sharing from within the VM:

    #! /bin/sh
    
    mkdir -p shared
    sudo mount -t 9p -o trans=virtio,version=9p2000.L host0 shared
  4. Explore the default dialog that has suggestions about updates and configuration

  5. Check for and Disable Undesirable Running Services

    $ sudo netstat -tunlp
    

    Likely cups, avahi, systemd-resolved (on tcp and udp port 53) are running.

    To stop and remove avahi:

    $ sudo apt remove avahi-daemon
    

    To stop and remove cups things:

    $ sudo apt purge cups cups-common cups-daemon
    

    To deal with systemd-resolved:

    sudo mkdir -p /etc/systemd/resolved.conf.d/
    

    Make a file at /etc/systemd/resolved.conf.d/disable-stub.conf with content:

    [Resolve]
    DNSStubListener=no
    

    Repoint /etc/resolv.conf to the non-stub file and restart systemd-resolved:

    $ sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
    $ sudo systemctl restart systemd-resolved    
    
  6. Shutdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment