Failed to determine IP address

This is the first snap I’m trying to create for Taskcoach, since it’s not anymore packaged for 20.04 and after that.

This is the error I get.

$ snapcraft
Launching a VM.
launch failed: The following errors occurred:
failed to determine IP address
An error occurred with the instance when trying to launch with 'multipass': returned exit code 2.
Ensure that 'multipass' is setup correctly and try again.

$ snap logs -f multipass
2020-12-25T21:05:11Z multipassd[137331]: starting: qemu-system-x86_64 -nographic -dump-vmstate /tmp/multipassd.137331
2020-12-25T21:05:11Z multipassd[137331]: qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.01H:ECX.vmx [bit 5]
2020-12-25T21:05:11Z multipassd[137331]: starting: qemu-system-x86_64 --enable-kvm -device virtio-scsi-pci,id=scsi0 -drive file=/var/snap/multipass/common/data/multipassd/
vault/instances/snapcraft-taskcoacha/bionic-server-cloudimg-amd64-disk.img,if=none,format=qcow2,discard=unmap,id=hda -device scsi-hd,drive=hda,bus=scsi0.0 -smp 2 -m 2048M
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:4f:0f:07 -netdev tap,id=hostnet0,ifname=tap-8940a8e895b,script=no,downscript=no -qmp stdio -cpu host -chardev n
ull,id=char0 -serial chardev:char0 -nographic -cdrom /var/snap/multipass/common/data/multipassd/vault/instances/snapcraft-taskcoacha/cloud-init-config.iso
2020-12-25T21:05:11Z multipassd[141957]: Applying AppArmor policy: multipass.snapcraft-taskcoacha.qemu-system-x86_64
2020-12-25T21:05:11Z multipassd[137331]: process started
2020-12-25T21:05:11Z multipassd[137331]: QMP: {"QMP": {"version": {"qemu": {"micro": 1, "minor": 11, "major": 2}, "package": "(Debian 1:2.11+dfsg-1ubuntu7.33)"}, "capabili
ties": []}}
2020-12-25T21:05:11Z multipassd[137331]: QMP: {"return": {}}
2020-12-25T21:05:35Z multipassd[137331]: QMP: {"timestamp": {"seconds": 1608930335, "microseconds": 623309}, "event": "NIC_RX_FILTER_CHANGED", "data": {"name": "net0", "pa
th": "/machine/peripheral/net0/virtio-backend"}}
2020-12-25T21:09:09Z multipassd[137331]: Cannot open ssh session on "snapcraft-taskcoacha" shutdown: failed to determine IP address
2020-12-25T21:09:09Z multipassd[137331]: Shutdown request delayed for 10 minutes

$ snap --version
snap    2.48.1
snapd   2.48.1
series  16
ubuntu  20.10
kernel  5.8.0-33-generic

$ snapcraft version
snapcraft, version 4.4.4

snapcraft.yaml, I highly doubt this works but here it is.

name: taskcoacha
base: core18
version: '0.1'
summary: Friendly task manager
description: |
  Task Coach is a simple open source todo manager to keep track of personal
  tasks and todo lists. It is designed for composite tasks, and also offers
  effort tracking, categories, notes and more.

grade: devel
confinement: devmode

parts:
  taskcoach:
    plugin: python
    python-version: python2
    source: https://sourceforge.net/projects/taskcoach/files/taskcoach/Release-1.4.6/TaskCoach-1.4.6.tar.gz/download
    source-subdir: TaskCoach-1.4.6
    stage-packages:
      - python2 
      - x11-utils
      - python-chardet 
      - python-dateutil
      - python-igraph
      - python-keyring 
      - python-lockfile 
      - python-pyparsing
      - python-squaremap 
      - python-xdg 
      - python-wxgtk3.0 
      - python-wxversion
      - python-twisted-core 
      - libxss1
      - fonts-dejavu
      - xdg-utils

apps:
  taskcoach:
    command: taskcoach.py
    plugs:
      - x11
      - home
      - desktop

I suspect this line from the logs is relevant:

TCG doesn't support requested feature: CPUID.01H:ECX.vmx [bit 5]

It probably indicates you’re either (a) running the build in a VM that does not support nested virtualisation, or (b) on a CPU that does not support virtualisation, possibly because it has been disabled in the BIOS settings.

Could you try running sudo kvm-ok to check whether the necessary features are available?

If you can’t enable the features needed to start virtual machines in your environment, you could try using LXD for the builds instead, as outlined here:

I’m not running this in a VM. I have run Virtualbox and qemu successfully on this CPU.

$ sudo kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used

I’ll test this later.