name: virt-manager
services:
  virt-manager:
    restart: always
    devices:
      - /dev/kvm:/dev/kvm
    environment:
      DARK_MODE: "false"
      HOSTS: "['qemu:///system']"
    image: mber5/virt-manager:latest
    network_mode: bridge
    ports:
      - target: 80
        published: "8185"
        protocol: tcp
    volumes:
      - type: bind
        source: /var/run/libvirt/libvirt-sock
        target: /var/run/libvirt/libvirt-sock
      - type: bind
        source: /var/lib/libvirt
        target: /var/lib/libvirt
      - type: bind
        source: /DATA/Downloads
        target: /DATA/Downloads
    x-casaos:
      envs:
        - container: DARK_MODE
          description:
            en_us: Set DARK_MODE to true to enable dark mode.
        - container: HOSTS
          description:
            en_us: Set HOSTS to "['qemu:///session']" to connect to a user session. Only change this option if you know what you're doing!
      ports:
        - container: "80"
          description:
            en_us: GUI HTTP port
      volumes:
        - container: /var/run/libvirt/libvirt-sock
          description:
            en_us: Libvirt socket
        - container: /var/lib/libvirt
          description:
            en_us: Libvirt directory
        - container: /DATA/Downloads
          description:
            en_us: Downloads directory
    container_name: virt-manager
x-casaos:
  architectures:
    - amd64
    - arm64
  main: virt-manager
  author: mber5
  category: Utilities
  tips:
    before_install:
      en_us: |
        # PLEASE READ WELL!
        ## Installing Necessary Dependencies on Host

        To make sure that everything works, you should first install ``qemu`` and ``libvirt`` on your system for the Virtual Machine Manager application to work, because otherwise it doesn't and won't be able to connect to the QEMU/KVM connection (this always applies if you have left HOST at the default).

        Ubuntu/Debian/Raspberry Pi OS:
        ```
        sudo apt update
        sudo apt install -y qemu-kvm libvirt-daemon-system libvirt-clients
        ```
        Alpine Linux:
        ```
        sudo apk update
        sudo apk add qemu libvirt qemu-img
        sudo rc-update add libvirtd default
        sudo systemctl enable --now libvirtd
        ```
        OpenWrt (compile from source):
        ```
        # Install necessary packages to compile from source
        sudo opkg update
        sudo opkg install build-essential libtool automake autoconf pkg-config libudev-dev libnl-tiny-dev glib2-dev libssl-dev

        # Clone QEMU and libvirt repositories
        git clone https://github.com/qemu/qemu.git
        git clone https://github.com/libvirt/libvirt.git

        # Build and install QEMU
        cd qemu
        ./configure
        make -j$(nproc)
        sudo make install

        # Build and install libvirt
        cd ../libvirt
        ./autogen.sh
        ./configure
        make -j$(nproc)
        sudo make install
        ```
        Arch Linux:
        ```
        sudo pacman -S --noconfirm qemu libvirt virt-manager
        sudo systemctl enable --now libvirtd
        ```

        ## Setting up Directories (for ISO Images, Hard Disk Images etc.)

        In order to set up directories and volumes for storing and accessing things (ISO and hard disk images for example), you can go to the panel for Virtual Machine Manager, right click on the 'QEMU/KVM' text at the homepage of Virtual Machine Manager and click on on 'Details'. From there, go to 'Storage' and click on the green plus icon. From there, you can choose a pool name and use 'Target Path' to choose the desired directory. E.g. for ISO images you can choose /DATA/Downloads (mounted on container at default) as directory to store ISO images. Then create it, and you're good to go! You can do the same if you'd want to store the hard disk images on another location or another drive (a volume/mount first needs to be configured with the settings of the Docker container of Virtual Machine Manager) and make sure to point it to the same path as on the host, in order to resolve conflicts when connecting to the server remotely! Also, if you desire you could also choose the ISO images manually from a path later on, but it has to be on the drive that the server uses and mounted.
        ## Troubleshooting
        ### No Connection Found

        Just go to 'File' > 'Add Connection...'. Make sure that the hypervisor is on QEMU/KVM and do NOT check the SSH option. I'd recommend to leave the automatic connection option turned on, and click 'Connect'. It should then be fixed!
  description:
    en_us: A GTK Broadway web UI for libvirt and virt-manager, to run virtual machines using QEMU/KVM.
    zh_cn: Libvirt 和 virt-manager 的 GTK Broadway Web UI，用于使用 QEMU/KVM 运行虚拟机。
    ar_sa: واجهة مستخدم ويب GTK Broadway لواجهة مستخدم الويب ل libvirt و libvirt-manager، لتشغيل الأجهزة الافتراضية باستخدام QEMU/KVM。
    de_de: Ein GTK Broadway Web UI für libvirt und virt-manager, um virtuelle Maschinen mit QEMU/KVM zu betreiben。
    es_es: Una interfaz web GTK Broadway para libvirt y virt-manager, para ejecutar máquinas virtuales usando QEMU/KVM.
    fr_fr: Une interface web GTK Broadway pour libvirt et virt-manager, pour exécuter des machines virtuelles utilisant QEMU/KVM.
    hu_hu: GTK Broadway webes felhasználói felület a libvirt és a virt-manager számára, virtuális gépek futtatásához QEMU/KVM használatával。
    it_it: Un'interfaccia web GTK Broadway per libvirt e virt-manager, per eseguire macchine virtuali utilizzando QEMU/KVM.
    ru_ru: Веб-интерфейс GTK Broadway для libvirt и virt-manager, позволяющий запускать виртуальные машины с помощью QEMU/KVM.
    pl_pl: Interfejs sieciowy GTK Broadway dla libvirt i virt-manager do uruchamiania maszyn wirtualnych przy użyciu QEMU/KVM.
    pt_br: Uma interface de usuário da Web GTK Broadway para libvirt e virt-manager, para executar máquinas virtuais usando QEMU/KVM.
    sv_se: Ett GTK Broadway webbgränssnitt för libvirt och virt-manager, för att köra virtuella maskiner med QEMU/KVM.
    uk_ua: Веб-інтерфейс GTK Broadway для libvirt та virt-manager для запуску віртуальних машин за допомогою QEMU/KVM.
  developer: Red Hat
  icon: https://cdn.jsdelivr.net/gh/IceWhaleTech/CasaOS-AppStore@main/Apps/VirtualMachineManager/icon.png
  screenshot_link:
    - https://cdn.jsdelivr.net/gh/IceWhaleTech/CasaOS-AppStore@main/Apps/VirtualMachineManager/screenshot-1.png
    - https://cdn.jsdelivr.net/gh/IceWhaleTech/CasaOS-AppStore@main/Apps/VirtualMachineManager/screenshot-2.png
  tagline:
    en_us: A GTK Broadway web UI for libvirt and virt-manager.
    zh_cn: Libvirt 和 virt-manager 的 GTK Broadway Web UI。
    de_de: Ein GTK Broadway Web UI für libvirt und virt-manager.
    es_es: Una interfaz web GTK Broadway para libvirt y virt-manager.
    fr_fr: Une interface web GTK Broadway pour libvirt et virt-manager.
    hu_hu: GTK Broadway webes felhasználói felület a libvirt és a virt-manager számára.
    it_it: Un'interfaccia web GTK Broadway per libvirt e virt-manager.
    ru_ru: Веб-интерфейс GTK Broadway для libvirt и virt-manager.
    pl_pl: Interfejs sieciowy GTK Broadway dla libvirt i virt-manager.
    pt_br: Uma interface de usuário da Web GTK Broadway para libvirt e virt-manager.
    sv_se: Ett GTK Broadway webbgränssnitt för libvirt och virt-manager.
    uk_ua: Веб-інтерфейс GTK Broadway для libvirt та virt-manager.
  port_map: "8185"
  scheme: http
  store_app_id: virtmanager
  title:
    en_us: Virtual Machine Manager
