Beginner question about Archlinux images

Good evening all.

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 :slight_smile:

Thanks in advance if anyone can help me here.

I reproduced your issue.

$ incus launch images:archlinux/cloud --vm --config security.secureboot=false my-arch
$ incus exec my-arch -- su -l arch
Error: VM agent isn't currently running

But if I wait a few seconds, I can connect.

$ incus exec my-arch -- su -l arch
[arch@my-arch ~]$ 

I think you might need to do the same thing. Can you try to connect again?

1 Like

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, …

1 Like

Thanks or getting back to me so fast you guys!!

Ok, I tried waiting as you did, and I still had no luck.
I waited about 20 minutes, and I still get the same error.

λ ~/ date
Thu Dec 28 10:02:15 PST 2023
λ ~/ incus launch images:archlinux/current/cloud --vm --config security.secureboot=false v2
Creating v2
Starting v2
λ ~/ date
Thu Dec 28 10:25:21 PST 2023
λ ~/ inc exec v2 -- su -l arch
Error: VM agent isn't currently running

The vm appears to be running correctly because I can get to the login prompt via console:

λ ~/ incus console v2
To detach from the console, press: <ctrl>+a q

archlinux login: arch
Password: <I tried no password and 'arch'>
Login incorrect

Here is my default config in case I’ve done something wrong there

λ ~/ incus profile show default
config: {}
description: Default Incus profile
devices:
  eth0:
    name: eth0
    network: incusbr0
    type: nic
  root:
    path: /
    pool: defualt
    type: disk
name: default
used_by:
- /1.0/instances/v1
- /1.0/instances/v2
λ ~/

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.

Hello @stgraber, thanks for taking the time!!

I am using the Incus 0.4-1 package from the Arch extra repo.

λ ~/ pacman -Qi incus
Name            : incus
Version         : 0.4-1
Description     : Powerful system container and virtual machine manager
Architecture    : x86_64
URL             : https://linuxcontainers.org/incus/
Licenses        : Apache-2.0
Groups          : None
Provides        : None
Depends On      : lxc  lxcfs  squashfs-tools  dnsmasq  cowsql  libuv  ebtables  raft  sqlite  libcap
                  acl
Optional Deps   : lvm2: lvm2 support [installed]
                  thin-provisioning-tools: thin provisioning support [installed]
                  btrfs-progs: btrfs storage driver support [installed]
                  minio: storage buckets support [installed]
                  cdrtools: VM support [installed]
                  qemu: VM support [installed]
                  edk2-ovmf: VM support [installed]
                  systemd-libs: unix device hotplug support [installed]
                  apparmor: apparmor support
Required By     : None
Optional For    : None
Conflicts With  : lxd
Replaces        : None
Installed Size  : 132.67 MiB
Packager        : Morten Linderud <foxboron@archlinux.org>
Build Date      : Sat Dec 23 11:00:52 2023
Install Date    : Tue Dec 26 20:40:12 2023
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature

λ ~/

When I ask where the incus and incus-agent binaries are I get:

λ ~/ which incus
/usr/bin/incus
λ ~/ incus --version
0.4
λ ~/ which incus-agent
/usr/bin/incus-agent
λ ~/ incus-agent --version
0.4
λ ~/

Then when looking for Incus in journalctl I get:

λ ~/ sudo journalctl --grep=incus
-- Boot 80f65847ac0b4839aadc5582ec8524bf --
-- Boot 68a295c912964f6e8b9ca6ff6da195e5 --
-- Boot a4b349e13bd64e9d8e6cfe8310fc45f2 --
-- Boot 7d594ab1cf124aa69d0edd65da34ee04 --
-- Boot 4865aa3f56c94709af1ea8d891a8b165 --
-- Boot 59049117994840c693dc057abbca8b21 --
-- Boot ef5bbb68e55840a5a7fbb4ff6173a4f7 --
-- Boot 53f0ef6ba45a4b798a2d07367ac9c75e --
-- Boot f065475c40b340439194fc8967e31507 --
-- Boot 91ded22eedf6449cb88eea9b1dae55db --
-- Boot 4444174e35b94d088348373e0838ecb9 --
-- Boot 278f879543a74591bcbbbf404f105709 --
-- Boot e6414e1ca53448d89c150d8ff3afd593 --
-- Boot 8b7bebef3ce44ecc94525773ef421f45 --
-- Boot af2b4377323341fcba094d9cb0904f49 --
-- Boot 0599f263549c46d9ac8d1ccba17cf0ca --
-- Boot 8a97c42089d34df3b80ebef6f1a6513f --
-- Boot cc1fdeb2a980425eab9343c388c74706 --
Lines 1-18

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:

λ ~/ incus launch images:archlinux/current  --vm --config security.secureboot=false v1
Creating v1
Starting v1
λ ~/ incus launch images:archlinux/current/cloud --vm --config security.secureboot=false v2
Creating v2
Starting v2
λ ~/ incus launch images:alpine/3.18 --vm --config security.secureboot=false v3
Creating v3
Starting v3
λ ~/ incus ls
+------+---------+----------------------+-----------------------------------------------+-----------------+-----------+
| NAME |  STATE  |         IPV4         |                     IPV6                      |      TYPE       | SNAPSHOTS |
+------+---------+----------------------+-----------------------------------------------+-----------------+-----------+
| v1   | RUNNING | 10.158.47.164 (eth0) | fd42:f36a:827c:e0ea:216:3eff:feb4:a399 (eth0) | VIRTUAL-MACHINE | 0         |
+------+---------+----------------------+-----------------------------------------------+-----------------+-----------+
| v2   | RUNNING | 10.158.47.49 (eth0)  | fd42:f36a:827c:e0ea:216:3eff:fe52:9036 (eth0) | VIRTUAL-MACHINE | 0         |
+------+---------+----------------------+-----------------------------------------------+-----------------+-----------+
| v3   | RUNNING | 10.158.47.168 (eth0) | fd42:f36a:827c:e0ea:216:3eff:fed2:d602 (eth0) | VIRTUAL-MACHINE | 0         |
+------+---------+----------------------+-----------------------------------------------+-----------------+-----------+

λ ~/ incus exec v1 -- su -l arch
Error: VM agent isn't currently running
λ ~/ incus exec v2 -- su -l arch
Error: VM agent isn't currently running
λ ~/ incus exec v3 bash
Error: VM agent isn't currently running
λ ~/

I also tried containers to see if I was able to log in there, and I was successful getting to a shell:

λ ~/ incus launch images:alpine/3.18 c1
Creating c1
Starting c1
λ ~/ incus launch images:ubuntu/22.04 c2
Creating c2
Starting c2
λ ~/ incus launch images:archlinux/current c3
Creating c3
Starting c3
λ ~/ inc ls
+------+---------+----------------------+-----------------------------------------------+-----------------+-----------+
| NAME |  STATE  |         IPV4         |                     IPV6                      |      TYPE       | SNAPSHOTS |
+------+---------+----------------------+-----------------------------------------------+-----------------+-----------+
| c1   | RUNNING | 10.158.47.44 (eth0)  | fd42:f36a:827c:e0ea:216:3eff:fe67:4b42 (eth0) | CONTAINER       | 0         |
+------+---------+----------------------+-----------------------------------------------+-----------------+-----------+
| c2   | RUNNING | 10.158.47.52 (eth0)  | fd42:f36a:827c:e0ea:216:3eff:fe13:5fde (eth0) | CONTAINER       | 0         |
+------+---------+----------------------+-----------------------------------------------+-----------------+-----------+
| c3   | RUNNING | 10.158.47.220 (eth0) | fd42:f36a:827c:e0ea:216:3eff:febe:3300 (eth0) | CONTAINER       | 0         |
+------+---------+----------------------+-----------------------------------------------+-----------------+-----------+
| v1   | RUNNING | 10.158.47.168 (eth0) | fd42:f36a:827c:e0ea:216:3eff:fe4f:f24d (eth0) | VIRTUAL-MACHINE | 0         |
+------+---------+----------------------+-----------------------------------------------+-----------------+-----------+
| v2   | RUNNING | 10.158.47.162 (eth0) | fd42:f36a:827c:e0ea:216:3eff:fe73:8b78 (eth0) | VIRTUAL-MACHINE | 0         |
+------+---------+----------------------+-----------------------------------------------+-----------------+-----------+
| v3   | RUNNING | 10.158.47.66 (eth0)  | fd42:f36a:827c:e0ea:216:3eff:fee4:666a (eth0) | VIRTUAL-MACHINE | 0         |
+------+---------+----------------------+-----------------------------------------------+-----------------+-----------+
λ ~/ incus exec c1 ash
~ # cat /etc/*release*
3.18.5
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.18.5
PRETTY_NAME="Alpine Linux v3.18"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"
~ # exit
λ ~/ incus exec c2 bash
root@c2:~# cat /etc/*release*
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.3 LTS"
PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
root@c2:~# exit
exit
λ ~/ incus exec c3 bash
[root@c3 ~]# cat /etc/*release*
NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://bugs.archlinux.org/"
PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
LOGO=archlinux-logo
IMAGE_ID=archlinux
IMAGE_VERSION=2023.12.01
[root@c3 ~]# exit
exit
λ ~/

Just to note, I did follow the Incus getting started steps and added my user to the incus-admin group and restarted my session when I rebooted.

Thank you all again for taking the time to help me here!
You’re all AWESOME!!

@Foxboron any ideas?

SOLVED!!

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.

Now I am able to exec to a shell correctly!!

λ ~/ incus exec v1 -- su -l arch
[arch@v1 ~]$ cat /etc/ *release*
NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://bugs.archlinux.org/"
PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
LOGO=archlinux-logo
IMAGE_ID=archlinux
IMAGE_VERSION=2023.12.01
[arch@v1 ~]$ exit
logout
λ ~/ 

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.

Thank you all for your help!!!

1 Like