Multipass on Raspberry Pi 3b+


#1

I just can’t get it to work!

System Information:

ubuntu@ubuntu:~$ uname -a
Linux ubuntu 4.15.0-1031-raspi2 #33-Ubuntu SMP PREEMPT Wed Jan 16 09:58:55 UTC 2019 armv7l armv7l armv7l GNU/Linux

ubuntu@ubuntu:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.2 LTS"

Relevant lines from dmesg:

[    0.003311] CPU: Testing write buffer coherency: ok
[    0.003829] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.020053] Setting up static identity map for 0x100000 - 0x100060
[    0.024051] Hierarchical SRCU implementation.
[    0.032095] smp: Bringing up secondary CPUs ...
[    0.052524] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.072562] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.092623] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.092751] smp: Brought up 1 node, 4 CPUs
[    0.092850] SMP: Total of 4 processors activated (153.60 BogoMIPS).
[    0.092881] CPU: All CPU(s) started in HYP mode.
[    0.092905] CPU: Virtualization extensions available.

But:

ubuntu@ubuntu:~$ sudo kvm-ok
INFO: Your CPU does not support KVM extensions
KVM acceleration can NOT be used

And:

ubuntu@ubuntu:~$ multipass launch -vvv
launch failed: failed to start qemu instance

ubuntu@ubuntu:~$ apt list --installed | grep qemu

ipxe-qemu/bionic-updates,now 1.0.0+git-20180124.fbe8c52d-0ubuntu2.2 all [installed,automatic]
ipxe-qemu-256k-compat-efi-roms/bionic,now 1.0.0+git-20150424.a25a16d-0ubuntu2 all [installed,automatic]
qemu-block-extra/bionic-updates,now 1:2.11+dfsg-1ubuntu7.15 armhf [installed,automatic]
qemu-kvm/bionic-updates,now 1:2.11+dfsg-1ubuntu7.15 armhf [installed]
qemu-system-arm/bionic-updates,now 1:2.11+dfsg-1ubuntu7.15 armhf [installed,automatic]
qemu-system-common/bionic-updates,now 1:2.11+dfsg-1ubuntu7.15 armhf [installed,automatic]
qemu-utils/bionic-updates,now 1:2.11+dfsg-1ubuntu7.15 armhf [installed,automatic]

Any help much appreciated. Been at this for days now.

Thanks :slight_smile:


#2

And also:

ubuntu@ubuntu:~$ cat /boot/firmware/config.txt
enable_uart=1
kernel=uboot.bin
device_tree_address=0x03000000
dtparam=i2c_arm=on
dtparam=spi=on

gpu_mem=16
dtparam=sd_overclock=100
dtoverlay=vc4-kms-v3d

#3

Possibly related: https://bugs.launchpad.net/ubuntu/+source/linux-raspi2/+bug/1783961


#4

… right, what @ijohnson said … but also, there is no KVM support at all on the 32bit arm arches AFAIK … you’d have to use the arm64 images to get it at all


#5

Thanks.

That link that was posted above is all I could find on the Internet. That’s why I edited the config.txt file. I tried both 32 and 64 bit distros.

So is the bottom line that we can’t use snaps on RPi? 32 bit or otherwise?


#6

why would you not be able to use snaps ? KVM/qemu is not used anywhere when running or installing snaps …

for building snaps you can use an lxd container or a chroot with the SNAPCRAFT_BUILD_ENVIRONMENT=host env variable set. you can just not build them using multipass (which sadly became a default with snapcraft 3.x limiting building without prior tinkering on non x86 a lot).


#7

Because every time I run snapcraft on a folder with snapcraft.yaml I get:

launch failed: failed to start qemu instance

I tracked it down to multipass


#8

Oh sorry. I missed the second part of this @ogra.

So you’re saying I can have it work like so:

 SNAPCRAFT_BUILD_ENVIRONMENT=host snapcraft

?

I don’t know what an lxd container is. I’ll do a search of it momentarily.

Thanks.


#9
sudo snap install lxd
sudo lxd init
(just hit enter for all questions)
sudo adduser $USER lxd
(log out and back in so the new group assignment takes effect)
...
lxc launch ubuntu:18.04 my-snapcraft-container
lxc exec -- my-snapcraft-container /bin/bash

now you are in a container, can install snapcraft and run snapcraft like you pointed out yourself above …


#10

Thought it was going great but…

root@bot-container:~# vi snapcraft.yaml
name: ros-base
base: core18
version: '0.1'
grade: stable
confinement: strict
summary: Single-line elevator pitch for your amazing snap # 79 char long summary
description: |
   This is my-snap's description. You have a paragraph or two to tell the
   most important story about your snap. Keep it under 100 words though,
  we live in tweetspace and your description wants to look good in the snap
  store.

slots:
  ros-base:
  content: ros-base-v1
  interface: content
  read: [/]

parts:
  ros-base:
    plugin: catkin
   rosdistro: kinetic
   include-roscore: true
   source-space: src/
   catkin-packages: []
   stage: &filter-out
     - -opt/ros/kinetic/.rosinstall
     - -opt/ros/kinetic/snapcraft-setup.sh
   snap: *filter-out

~
~
~
~
~
~
~
"snapcraft.yaml" 30L, 747C written
root@bot-container:~# snapcraft
Using 'snapcraft.yaml': Project assets will be searched for from the 'snap' directory.
Support for 'multipass' needs to be set up. Would you like to do that it now? [y/N]: y
snapd is not logged in, snap install commands will use sudo
multipass (beta) 0.7.1 from Canonical✓ installed
Waiting for multipass...
Launching a VM.
launch failed: failed to start qemu instance
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.
root@bot-container:~#

#11

Did you set the environment variable SNAPCRAFT_BUILD_ENVIRONMENT=host ? You need to set that before snapcraft will run a “native build” inside your container you created.


#12

Alright… so I set the variable… And now

root@bot-container:~/ros# snapcraft
Using 'snapcraft.yaml': Project assets will be searched for from the 'snap' directory.
Failed to load plugin: properties failed to load for ros-base: 'source' is a required property

so I added source: . to the parts: ros-base:

Then I got:

root@bot-container:~/ros# snapcraft
Using 'snapcraft.yaml': Project assets will be searched for from the 'snap' directory.
Failed to load plugin: properties failed to load for ros-base: Additional properties are not allowed ('rosdistro', 'snap' were unexpected)

So I removed them and ran snapcraft again. Only to get

Could not find a required package in 'build-packages': python-pip

What does that mean??


#13

Sorry, late night, long day. sudo apt update did it for me