|
| 1 | +--- |
| 2 | +title: QEMU on antiX Linux |
| 3 | +description: A guide to Setup QEMU on antiX Linux 23.2 |
| 4 | +--- |
| 5 | + |
| 6 | +import { Steps } from "@astrojs/starlight/components"; |
| 7 | +import { Tabs, TabItem } from '@astrojs/starlight/components'; |
| 8 | + |
| 9 | +this guide will walk you though setting up QEMU, Virt Manager on Antix Linux runit v23.2, the instructions are inspired by [ this antix linux forum ](https://www.antixforum.com/forums/topic/how-to-setup-qemu-virt-manager-virt-viewer-on-antix-linux/) |
| 10 | + |
| 11 | +<Steps> |
| 12 | +1. ## Install Dependecies |
| 13 | + |
| 14 | + according to official [ QEMU guide ](https://www.qemu.org/download/#linux), run install these Dependecies |
| 15 | + ```sh |
| 16 | + sudo apt install qemu-system qemu-utils dnsmasq-base qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils virt-manager gir1.2-spiceclientgtk-3.0 spice-vdagent |
| 17 | + |
| 18 | + ``` |
| 19 | +2. ## Setup Deamons and Services |
| 20 | + |
| 21 | + to setup the `libvirtd`, `virtlockd`, `virtlogd` services, clone this [ gitlab repo ](https://gitlab.com/techore/libvirt-runit) |
| 22 | + ```sh |
| 23 | + git clone https://gitlab.com/techore/libvirt-runit |
| 24 | + ``` |
| 25 | + then copy the files to the required locations |
| 26 | + ```sh |
| 27 | + cd libvirt-runit |
| 28 | + |
| 29 | + sudo cp -r etc/* /etc/ |
| 30 | + sudo cp -r var/* /var/ |
| 31 | + |
| 32 | + sudo ln -s /etc/sv/libvirtd /etc/service/libvirtd |
| 33 | + sudo ln -s /etc/sv/virtlockd /etc/service/virtlockd |
| 34 | + sudo ln -s /etc/sv/virtlogd /etc/service/virtlogd |
| 35 | + |
| 36 | + sudo sv start libvirtd |
| 37 | + sudo sv start virtlockd |
| 38 | + sudo sv start virtlogd |
| 39 | + |
| 40 | + sudo mkdir /usr/share/runit/sv/libvirtd |
| 41 | + sudo mkdir /usr/share/runit/sv/virtlockd |
| 42 | + sudo mkdir /usr/share/runit/sv/virtlogd |
| 43 | + |
| 44 | + sudo cp /etc/sv/libvirtd/run /usr/share/runit/sv/libvirtd/ |
| 45 | + sudo cp /etc/sv/virtlockd/run /usr/share/runit/sv/virtlockd/ |
| 46 | + sudo cp /etc/sv/virtlockd/run /usr/share/runit/sv/virtlockd/ |
| 47 | + ``` |
| 48 | + |
| 49 | + now, set the qemu network service on host system to autostart on startup |
| 50 | + ```sh |
| 51 | + sudo virsh net-autostart default |
| 52 | + ``` |
| 53 | + |
| 54 | +3. ## Add User to `libvirt` group |
| 55 | + |
| 56 | + this step is a common miss, not doing this causes `authentication unavailable: no polkit agent available to authenticate action 'org.libvirt.unix.manage'` |
| 57 | + |
| 58 | + ```sh |
| 59 | + sudo usermod -aG libvirt $(whoami) |
| 60 | + ``` |
| 61 | + |
| 62 | +4. ## Setup shared clipboard (Optional) |
| 63 | + if you're running a linux OS in the Virtual Machine and want to have a shared clipboard amoung host and guest OS, then : |
| 64 | + on the **Guest System** (the Virtual Machine), |
| 65 | + you need to install the `spice-vdagent` package \ |
| 66 | + choose your **Guest OS** and run the given command : |
| 67 | + |
| 68 | + <Tabs> |
| 69 | + <TabItem label="Debian Based"> |
| 70 | + ```shell |
| 71 | + sudo apt install spice-vdagent |
| 72 | + ``` |
| 73 | + </TabItem> |
| 74 | + <TabItem label="Fedora Based"> |
| 75 | + ```shell |
| 76 | + sudo dnf install spice-vdagent |
| 77 | + ``` |
| 78 | + </TabItem> |
| 79 | + <TabItem label="Arch Based"> |
| 80 | + ```shell |
| 81 | + sudo pacman -S spice-vdagent |
| 82 | + ``` |
| 83 | + </TabItem> |
| 84 | + </Tabs> |
| 85 | + |
| 86 | + after that, you need to start the `spice-vdagent` on startup on your **Guest OS**\ |
| 87 | + choose the **Guest OS** to see instruction |
| 88 | + |
| 89 | + <Tabs> |
| 90 | + <TabItem label="Antix Linux"> |
| 91 | + add this line at the end to the `~/.desktop-session/startup` file |
| 92 | + ```sh |
| 93 | + spice-vdagent & |
| 94 | + ``` |
| 95 | + </TabItem> |
| 96 | + <TabItem label="Other Os"> |
| 97 | + you would need to google for "how to setup a service to run on startup on \<your os\>" |
| 98 | + </TabItem> |
| 99 | + </Tabs> |
| 100 | +</Steps> |
| 101 | + |
| 102 | + |
0 commit comments