I have a question that I hope has a simple answer.
Using Incus 0.4, on an Arch host, with a ZFS pool, and trying to run the archlinux default vm image:
I am not able to exec into a bash shell
Specifically I get the following error:
$ incus exec v1 bash
Error: VM agent isn't currently running
$
I can “incus start v1 --console”, or “incus console v1”.
However, the console presents me with a prompt for a username/password, which I don’t think is setup yet.
I’ve searched here and I found one post about using cloud.init, and that being out of date.
However, I’m not a power user, not am I trying to build a huge thing.
I’d just like to use Incus for a quick VM so I can test configs for various things without breaking my main machine
Unlike containers, the VMs indeed need a bit of time to go through their boot process and start the agent service that’s needed for things like incus exec, incus file, …
Is that using the new ArchLinux packages from the extra repository or was that using AUR?
In either case, the incus-agent binary must be present on the host system and be somewhere that incus can detect. You may want to check the incus log (/var/log/incus/incus.log or if not present, the systemd journal) for a message along the lines of incus-agent not found, skipping its inclusion in the VM config drive.
I also tried using another VM image just in case it was an issue with Arch specifically.
I tried alpine and I got the same response. So all together that looked like this:
Ok, unfortunately I didn’t capture the error I was seeing because I accidentally restarted my zellij session.
However, when I looked at the logs with incus info v* --show-log I saw several errors that were attributed to “qemu-system-x64”.
So I then looked at my install of Qemu.
Before this I’d installed the “qemu-full” group in Arch via pacman.
However, apparently I was missing a package.
λ ~/ pacman -Qi qemu
Name : qemu-base
Version : 8.2.0-1
Description : A basic QEMU setup for headless environments
Architecture : x86_64
URL : https://www.qemu.org/
Licenses : Apache-2.0 BSD-2-Clause BSD-3-Clause FSFAP GPL-1.0-or-later GPL-2.0-only GPL-2.0-or-later GPL-2.0-or-later WITH GCC-exception-2.0 LGPL-2.0-only LGPL-2.0-or-later LGPL-2.1-only
LGPL-2.1-or-later MIT public-domain CC-BY-3.0
Groups : None
Provides : qemu=8.2.0
Depends On : qemu-common=8.2.0-1 qemu-img=8.2.0-1 qemu-system-x86=8.2.0-1 virtiofsd
Optional Deps : qemu-user-static: for static user mode emulation of QEMU targets
samba: for SMB/CIFS server support
qemu-block-gluster: for Gluster block driver
qemu-block-iscsi: for iSCSI block driver
qemu-chardev-baum: for Baum chardev driver
qemu-docs: for documentation
qemu-emulators-full: for all system emulators
qemu-full: for a full QEMU installation
qemu-hw-s390x-virtio-gpu-ccw: for s390x-virtio-gpu-ccw display device [installed]
qemu-pr-helper: for persistent reservation utility [installed]
qemu-system-aarch64: for AARCH64 system emulator
qemu-system-alpha: for Alpha system emulator
qemu-system-arm: for ARM system emulator [installed]
qemu-system-avr: for AVR system emulator
qemu-system-cris: for CRIS system emulator
qemu-system-hppa: for HPPA system emulator
qemu-system-m68k: for ColdFire (m68k) system emulator
qemu-system-microblaze: for Microblaze system emulator
qemu-system-mips: for MIPS system emulator
qemu-system-nios2: for nios2 system emulator
qemu-system-or1k: for OpenRisc32 system emulator
qemu-system-ppc: for PPC system emulator
qemu-system-riscv: for RISC-V system emulator
qemu-system-rx: for RX system emulator
qemu-system-s390x: for S390 system emulator
qemu-system-sh4: for SH4 system emulator
qemu-system-sparc: for SPARC system emulator
qemu-system-tricore: for tricore system emulator
qemu-system-xtensa: for Xtensa system emulator
qemu-tests: for QEMU tests
qemu-tools: for QEMU tools [installed]
qemu-user: for user mode emulation of QEMU targets
qemu-audio-alsa: for ALSA audio driver [installed]
qemu-audio-dbus: for D-Bus audio driver [installed]
qemu-audio-jack: for JACK audio driver [installed]
qemu-audio-oss: for OSS audio driver [installed]
qemu-audio-pa: for PulseAudio audio driver [installed]
qemu-audio-pipewire: for PipeWire audio driver [installed]
qemu-audio-sdl: for SDL audio driver [installed]
qemu-audio-spice: for spice audio driver [installed]
qemu-block-curl: for curl block driver [installed]
qemu-block-dmg: for DMG block driver [installed]
qemu-block-nfs: for NFS block driver [installed]
qemu-block-ssh: for SSH block driver [installed]
qemu-chardev-spice: for the spice chardev driver [installed]
qemu-desktop: for dependencies commonly used on a desktop [installed]
qemu-hw-display-qxl: for the QXL display device [installed]
qemu-hw-display-virtio-vga: for the virtio-vga display device [installed]
qemu-hw-display-virtio-vga-gl: for the virtio-vga-gl display device [installed]
qemu-hw-display-virtio-gpu: for the virtio-gpu display device [installed]
qemu-hw-display-virtio-gpu-gl: for the virtio-gpu-gl display device [installed]
qemu-hw-display-virtio-gpu-pci: for the virtio-gpu-pci display device [installed]
qemu-hw-display-virtio-gpu-pci-gl: for the virtio-gpu-pci-gl display device [installed]
qemu-hw-usb-host: for host USB support [installed]
qemu-hw-usb-redirect: for USB redirect support [installed]
qemu-hw-usb-smartcard: for USB smartcard support [installed]
qemu-ui-curses: for ncurses UI driver [installed]
qemu-ui-dbus: for D-Bus UI driver [installed]
qemu-ui-egl-headless: for EGL headless UI driver [installed]
qemu-ui-gtk: for GTK UI driver [installed]
qemu-ui-opengl: for OpenGL UI driver [installed]
qemu-ui-sdl: for SDL UI driver [installed]
qemu-ui-spice-app: for spice app UI driver [installed]
qemu-ui-spice-core: for spice core UI driver [installed]
qemu-user: for user mode emulation of QEMU targets
qemu-vhost-user-gpu: for vhost-user-gpu display device [installed]
Required By : qemu-desktop
Optional For : incus
Conflicts With : None
Replaces : None
Installed Size : 0.00 B
Packager : David Runge <dvzrv@archlinux.org>
Build Date : Wed Dec 20 02:34:20 2023
Install Date : Tue Dec 26 20:36:43 2023
Install Reason : Installed as a dependency for another package
Install Script : No
Validated By : Signature
Specifically I saw that qemu-user was not installed and the description said “for user mode emulation of QEMU targets”.
So I installed qemu-user with sudo pacman -S qemu-user and rebooted.
Incidentally, I am now also no longer experiencing what I know now was an extended wait time for shut down of VMs. I was using incus stop -f <vmname> before. But now I can just use incus stop <vmname> and the VM will stop within 2 seconds.