"""
stgraber@castiana:~$ lxc launch images:ubuntu/focal f1 --vm
Creating f1
Starting f1
stgraber@castiana:~$ lxc exec f1 bash
root@f1:~# echo "deb http://archive.ubuntu.com/ubuntu focal-proposed main 
restricted universe multiverse" >> /etc/apt/sources.list
root@f1:~# apt-get update
Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease [107 kB]
Get:3 http://security.ubuntu.com/ubuntu focal-security InRelease [107 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal-proposed InRelease [265 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [201 
kB]
Get:6 http://archive.ubuntu.com/ubuntu focal-updates/main Translation-en [80.2 
kB]
Get:7 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages 
[11.1 kB]
Get:8 http://archive.ubuntu.com/ubuntu focal-updates/restricted Translation-en 
[3036 B]
Get:9 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages 
[114 kB]
Get:10 http://archive.ubuntu.com/ubuntu focal-proposed/main amd64 Packages 
[82.4 kB]
Get:11 http://archive.ubuntu.com/ubuntu focal-proposed/main Translation-en 
[35.0 kB]
Get:12 http://archive.ubuntu.com/ubuntu focal-proposed/restricted amd64 
Packages [7132 B]
Get:13 http://archive.ubuntu.com/ubuntu focal-proposed/restricted 
Translation-en [2144 B]
Get:14 http://archive.ubuntu.com/ubuntu focal-proposed/universe amd64 Packages 
[35.8 kB]
Get:15 http://archive.ubuntu.com/ubuntu focal-proposed/universe Translation-en 
[24.5 kB]
Get:16 http://archive.ubuntu.com/ubuntu focal-proposed/multiverse 
Translation-en [3404 B]
Fetched 1079 kB in 1s (794 kB/s)                                   
Reading package lists... Done
root@f1:~# apt-get install linux-kvm
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  linux-headers-5.4.0-1017-kvm linux-headers-kvm linux-image-5.4.0-1017-kvm 
linux-image-kvm linux-kvm-headers-5.4.0-1017 linux-modules-5.4.0-1017-kvm
Suggested packages:
  fdutils linux-kvm-doc-5.4.0 | linux-kvm-source-5.4.0 linux-kvm-tools
The following NEW packages will be installed:
  linux-headers-5.4.0-1017-kvm linux-headers-kvm linux-image-5.4.0-1017-kvm 
linux-image-kvm linux-kvm linux-kvm-headers-5.4.0-1017
  linux-modules-5.4.0-1017-kvm
0 upgraded, 7 newly installed, 0 to remove and 18 not upgraded.
Need to get 28.4 MB of archives.
After this operation, 126 MB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 http://archive.ubuntu.com/ubuntu focal-proposed/main amd64 
linux-kvm-headers-5.4.0-1017 all 5.4.0-1017.17 [11.3 MB]
Get:2 http://archive.ubuntu.com/ubuntu focal-proposed/main amd64 
linux-headers-5.4.0-1017-kvm amd64 5.4.0-1017.17 [1254 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal-proposed/main amd64 
linux-headers-kvm amd64 5.4.0.1017.16 [4376 B]
Get:4 http://archive.ubuntu.com/ubuntu focal-proposed/main amd64 
linux-modules-5.4.0-1017-kvm amd64 5.4.0-1017.17 [10.6 MB]
Get:5 http://archive.ubuntu.com/ubuntu focal-proposed/main amd64 
linux-image-5.4.0-1017-kvm amd64 5.4.0-1017.17 [5158 kB]
Get:6 http://archive.ubuntu.com/ubuntu focal-proposed/main amd64 
linux-image-kvm amd64 5.4.0.1017.16 [4444 B]
Get:7 http://archive.ubuntu.com/ubuntu focal-proposed/main amd64 linux-kvm 
amd64 5.4.0.1017.16 [4416 B]
Fetched 28.4 MB in 2s (14.2 MB/s)
Selecting previously unselected package linux-kvm-headers-5.4.0-1017.
(Reading database ... 46372 files and directories currently installed.)
Preparing to unpack .../0-linux-kvm-headers-5.4.0-1017_5.4.0-1017.17_all.deb ...
Unpacking linux-kvm-headers-5.4.0-1017 (5.4.0-1017.17) ...
Selecting previously unselected package linux-headers-5.4.0-1017-kvm.
Preparing to unpack .../1-linux-headers-5.4.0-1017-kvm_5.4.0-1017.17_amd64.deb 
...
Unpacking linux-headers-5.4.0-1017-kvm (5.4.0-1017.17) ...
Selecting previously unselected package linux-headers-kvm.
Preparing to unpack .../2-linux-headers-kvm_5.4.0.1017.16_amd64.deb ...
Unpacking linux-headers-kvm (5.4.0.1017.16) ...
Selecting previously unselected package linux-modules-5.4.0-1017-kvm.
Preparing to unpack .../3-linux-modules-5.4.0-1017-kvm_5.4.0-1017.17_amd64.deb 
...
Unpacking linux-modules-5.4.0-1017-kvm (5.4.0-1017.17) ...
Selecting previously unselected package linux-image-5.4.0-1017-kvm.
Preparing to unpack .../4-linux-image-5.4.0-1017-kvm_5.4.0-1017.17_amd64.deb ...
Unpacking linux-image-5.4.0-1017-kvm (5.4.0-1017.17) ...
Selecting previously unselected package linux-image-kvm.
Preparing to unpack .../5-linux-image-kvm_5.4.0.1017.16_amd64.deb ...
Unpacking linux-image-kvm (5.4.0.1017.16) ...
Selecting previously unselected package linux-kvm.
Preparing to unpack .../6-linux-kvm_5.4.0.1017.16_amd64.deb ...
Unpacking linux-kvm (5.4.0.1017.16) ...
Setting up linux-kvm-headers-5.4.0-1017 (5.4.0-1017.17) ...
Setting up linux-modules-5.4.0-1017-kvm (5.4.0-1017.17) ...
Setting up linux-headers-5.4.0-1017-kvm (5.4.0-1017.17) ...
Setting up linux-headers-kvm (5.4.0.1017.16) ...
Setting up linux-image-5.4.0-1017-kvm (5.4.0-1017.17) ...
I: /boot/vmlinuz is now a symlink to vmlinuz-5.4.0-1017-kvm
I: /boot/initrd.img is now a symlink to initrd.img-5.4.0-1017-kvm
Setting up linux-image-kvm (5.4.0.1017.16) ...
Setting up linux-kvm (5.4.0.1017.16) ...
Processing triggers for linux-image-5.4.0-1017-kvm (5.4.0-1017.17) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.4.0-1017-kvm
/etc/kernel/postinst.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/50-lxd.cfg'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.0-1017-kvm
Found initrd image: /boot/initrd.img-5.4.0-1017-kvm
Found linux image: /boot/vmlinuz-5.4.0-37-generic
Found initrd image: /boot/initrd.img-5.4.0-37-generic
Adding boot menu entry for UEFI Firmware Settings
done
root@f1:~# sed -i 's/GRUB_TIMEOUT=0/GRUB_TIMEOUT=10/g' 
/etc/default/grub.d/50-lxd.cfg
root@f1:~# apt-get remove --purge linux.*generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'linux-modules-nvidia-435-5.4.0-38-generic' for regex 
'linux.*generic'
Note, selecting 'linux-headers-generic-hwe-18.04-edge' for regex 
'linux.*generic'
Note, selecting 'linux-modules-5.4.0-38-generic' for regex 'linux.*generic'
Note, selecting 'linux-headers-generic-hwe-20.04' for regex 'linux.*generic'
Note, selecting 'linux-modules-nvidia-435-5.4.0-37-generic' for regex 
'linux.*generic'
Note, selecting 'linux-image-5.4.0-29-generic' for regex 'linux.*generic'
Note, selecting 'linux-tools-generic' for regex 'linux.*generic'
Note, selecting 'linux-image-unsigned-5.4.0-31-generic' for regex 
'linux.*generic'
Note, selecting 'linux-headers-5.4.0-26-generic' for regex 'linux.*generic'
Note, selecting 'linux-headers-generic' for regex 'linux.*generic'
Note, selecting 'linux-image-generic-hwe-18.04-edge' for regex 'linux.*generic'
Note, selecting 'linux-buildinfo-5.4.0-28-generic' for regex 'linux.*generic'
Note, selecting 'linux-cloud-tools-generic' for regex 'linux.*generic'
Note, selecting 'linux-tools-generic-hwe-18.04-edge' for regex 'linux.*generic'
Note, selecting 'linux-modules-nvidia-390-5.4.0-31-generic' for regex 
'linux.*generic'
Note, selecting 'linux-image-5.4.0-31-generic' for regex 'linux.*generic'
Note, selecting 'linux-modules-extra-5.4.0-26-generic' for regex 
'linux.*generic'
Note, selecting 'linux-modules-nvidia-440-generic' for regex 'linux.*generic'
Note, selecting 'linux-buildinfo-5.4.0-26-generic' for regex 'linux.*generic'
Note, selecting 'linux-image-unsigned-5.4.0-33-generic' for regex 
'linux.*generic'
Note, selecting 'linux-headers-5.4.0-28-generic' for regex 'linux.*generic'
Note, selecting 'linux-image-generic' for regex 'linux.*generic'
Note, selecting 'linux-modules-nvidia-440-5.4.0-26-generic' for regex 
'linux.*generic'
Note, selecting 'linux-tools-generic-hwe-18.04' for regex 'linux.*generic'
Note, selecting 'linux-image-unsigned-5.4.0-37-generic' for regex 
'linux.*generic'
Note, selecting 'linux-modules-extra-5.4.0-29-generic' for regex 
'linux.*generic'
Note, selecting 'linux-modules-nvidia-390-5.4.0-33-generic' for regex 
'linux.*generic'
Note, selecting 'linux-buildinfo-5.4.0-29-generic' for regex 'linux.*generic'
Note, selecting 'linux-image-5.4.0-33-generic' for regex 'linux.*generic'
Note, selecting 'linux-headers-generic-hwe-18.04' for regex 'linux.*generic'
Note, selecting 'linux-modules-extra-5.4.0-28-generic' for regex 
'linux.*generic'
Note, selecting 'linux-modules-nvidia-390-5.4.0-37-generic' for regex 
'linux.*generic'
Note, selecting 'linux-tools-5.4.0-26-generic' for regex 'linux.*generic'
Note, selecting 'linux-modules-nvidia-435-generic-hwe-20.04' for regex 
'linux.*generic'
Note, selecting 'linux-generic-hwe-18.04-edge' for regex 'linux.*generic'
Note, selecting 'linux-modules-nvidia-440-5.4.0-28-generic' for regex 
'linux.*generic'
Note, selecting 'linux-cloud-tools-5.4.0-26-generic' for regex 'linux.*generic'
Note, selecting 'linux-buildinfo-5.4.0-31-generic' for regex 'linux.*generic'
Note, selecting 'linux-headers-5.4.0-29-generic' for regex 'linux.*generic'
Note, selecting 'linux-tools-5.4.0-29-generic' for regex 'linux.*generic'
Note, selecting 'linux-modules-nvidia-390-generic' for regex 'linux.*generic'
Note, selecting 'linux-image-unsigned-5.4.0-38-generic' for regex 
'linux.*generic'
Note, selecting 'linux-tools-5.4.0-28-generic' for regex 'linux.*generic'
Note, selecting 'linux-image-generic-hwe-20.04' for regex 'linux.*generic'
Note, selecting 'linux-modules-5.4.0-26-generic' for regex 'linux.*generic'
Note, selecting 'linux-headers-5.4.0-31-generic' for regex 'linux.*generic'
Note, selecting 'linux-tools-5.4.0-31-generic' for regex 'linux.*generic'
Note, selecting 'linux-modules-nvidia-390-5.4.0-38-generic' for regex 
'linux.*generic'
Note, selecting 'linux-image-5.4.0-38-generic' for regex 'linux.*generic'
Note, selecting 'linux-cloud-tools-5.4.0-28-generic' for regex 'linux.*generic'
Note, selecting 'linux-buildinfo-5.4.0-33-generic' for regex 'linux.*generic'
Note, selecting 'linux-modules-nvidia-440-5.4.0-29-generic' for regex 
'linux.*generic'
Note, selecting 'linux-image-5.4.0-37-generic' for regex 'linux.*generic'
Note, selecting 'linux-generic-hwe-20.04' for regex 'linux.*generic'
Note, selecting 'linux-modules-5.4.0-29-generic' for regex 'linux.*generic'
Note, selecting 'kernel-testing--linux--full--generic' for regex 
'linux.*generic'
Note, selecting 'linux-modules-extra-5.4.0-31-generic' for regex 
'linux.*generic'
Note, selecting 'linux-modules-5.4.0-28-generic' for regex 'linux.*generic'
Note, selecting 'linux-headers-5.4.0-33-generic' for regex 'linux.*generic'
Note, selecting 'linux-tools-5.4.0-33-generic' for regex 'linux.*generic'
Note, selecting 'linux-modules-nvidia-440-5.4.0-31-generic' for regex 
'linux.*generic'
Note, selecting 'linux-modules-5.4.0-31-generic' for regex 'linux.*generic'
Note, selecting 'linux-cloud-tools-5.4.0-29-generic' for regex 'linux.*generic'
Note, selecting 'linux-cloud-tools-generic-hwe-18.04-edge' for regex 
'linux.*generic'
Note, selecting 'linux-modules-extra-5.4.0-33-generic' for regex 
'linux.*generic'
Note, selecting 'linux-cloud-tools-generic-hwe-20.04' for regex 'linux.*generic'
Note, selecting 'linux-image-generic-hwe-18.04' for regex 'linux.*generic'
Note, selecting 'linux-buildinfo-5.4.0-38-generic' for regex 'linux.*generic'
Note, selecting 'linux-modules-extra-5.4.0-37-generic' for regex 
'linux.*generic'
Note, selecting 'linux-modules-nvidia-430-generic' for regex 'linux.*generic'
Note, selecting 'linux-modules-nvidia-435-5.4.0-29-generic' for regex 
'linux.*generic'
Note, selecting 'linux-modules-nvidia-440-5.4.0-33-generic' for regex 
'linux.*generic'
Note, selecting 'linux-buildinfo-5.4.0-37-generic' for regex 'linux.*generic'
Note, selecting 'linux-cloud-tools-5.4.0-31-generic' for regex 'linux.*generic'
Note, selecting 'linux-modules-5.4.0-33-generic' for regex 'linux.*generic'
Note, selecting 'linux-generic-hwe-18.04' for regex 'linux.*generic'
Note, selecting 'linux-modules-nvidia-440-generic-hwe-20.04' for regex 
'linux.*generic'
Note, selecting 'linux-headers-5.4.0-38-generic' for regex 'linux.*generic'
Note, selecting 'linux-modules-nvidia-435-5.4.0-31-generic' for regex 
'linux.*generic'
Note, selecting 'linux-image-unsigned-5.4.0-26-generic' for regex 
'linux.*generic'
Note, selecting 'linux-headers-5.4.0-37-generic' for regex 'linux.*generic'
Note, selecting 'linux-tools-5.4.0-37-generic' for regex 'linux.*generic'
Note, selecting 'linux-cloud-tools-5.4.0-33-generic' for regex 'linux.*generic'
Note, selecting 'linux-modules-extra-5.4.0-38-generic' for regex 
'linux.*generic'
Note, selecting 'linux-modules-nvidia-390-5.4.0-26-generic' for regex 
'linux.*generic'
Note, selecting 'linux-image-unsigned-5.4.0-29-generic' for regex 
'linux.*generic'
Note, selecting 'linux-modules-nvidia-435-generic' for regex 'linux.*generic'
Note, selecting 'linux-cloud-tools-generic-hwe-18.04' for regex 'linux.*generic'
Note, selecting 'linux-modules-nvidia-435-5.4.0-33-generic' for regex 
'linux.*generic'
Note, selecting 'linux-modules-nvidia-440-5.4.0-38-generic' for regex 
'linux.*generic'
Note, selecting 'linux-image-unsigned-5.4.0-28-generic' for regex 
'linux.*generic'
Note, selecting 'linux-modules-nvidia-390-5.4.0-29-generic' for regex 
'linux.*generic'
Note, selecting 'linux-modules-nvidia-390-generic-hwe-20.04' for regex 
'linux.*generic'
Note, selecting 'linux-modules-nvidia-440-5.4.0-37-generic' for regex 
'linux.*generic'
Note, selecting 'linux-modules-5.4.0-37-generic' for regex 'linux.*generic'
Note, selecting 'linux-modules-nvidia-390-5.4.0-28-generic' for regex 
'linux.*generic'
Note, selecting 'linux-tools-5.4.0-38-generic' for regex 'linux.*generic'
Note, selecting 'linux-image-5.4.0-28-generic' for regex 'linux.*generic'
Note, selecting 'linux-generic' for regex 'linux.*generic'
Note, selecting 'linux-cloud-tools-5.4.0-38-generic' for regex 'linux.*generic'
Note, selecting 'linux-image-5.4.0-26-generic' for regex 'linux.*generic'
Note, selecting 'linux-cloud-tools-5.4.0-37-generic' for regex 'linux.*generic'
Note, selecting 'linux-tools-generic-hwe-20.04' for regex 'linux.*generic'
Note, selecting 'linux-generic' instead of 
'kernel-testing--linux--full--generic'
Package 'linux-buildinfo-5.4.0-26-generic' is not installed, so not removed
Package 'linux-cloud-tools-5.4.0-26-generic' is not installed, so not removed
Package 'linux-headers-5.4.0-26-generic' is not installed, so not removed
Package 'linux-image-5.4.0-26-generic' is not installed, so not removed
Package 'linux-image-unsigned-5.4.0-26-generic' is not installed, so not removed
Package 'linux-modules-5.4.0-26-generic' is not installed, so not removed
Package 'linux-modules-extra-5.4.0-26-generic' is not installed, so not removed
Package 'linux-tools-5.4.0-26-generic' is not installed, so not removed
Package 'linux-modules-nvidia-390-5.4.0-26-generic' is not installed, so not 
removed
Package 'linux-modules-nvidia-440-5.4.0-26-generic' is not installed, so not 
removed
Package 'linux-buildinfo-5.4.0-28-generic' is not installed, so not removed
Package 'linux-buildinfo-5.4.0-29-generic' is not installed, so not removed
Package 'linux-buildinfo-5.4.0-31-generic' is not installed, so not removed
Package 'linux-buildinfo-5.4.0-33-generic' is not installed, so not removed
Package 'linux-buildinfo-5.4.0-37-generic' is not installed, so not removed
Package 'linux-cloud-tools-5.4.0-28-generic' is not installed, so not removed
Package 'linux-cloud-tools-5.4.0-29-generic' is not installed, so not removed
Package 'linux-cloud-tools-5.4.0-31-generic' is not installed, so not removed
Package 'linux-cloud-tools-5.4.0-33-generic' is not installed, so not removed
Package 'linux-cloud-tools-5.4.0-37-generic' is not installed, so not removed
Package 'linux-headers-5.4.0-28-generic' is not installed, so not removed
Package 'linux-headers-5.4.0-29-generic' is not installed, so not removed
Package 'linux-headers-5.4.0-31-generic' is not installed, so not removed
Package 'linux-headers-5.4.0-33-generic' is not installed, so not removed
Package 'linux-image-5.4.0-28-generic' is not installed, so not removed
Package 'linux-image-5.4.0-29-generic' is not installed, so not removed
Package 'linux-image-5.4.0-31-generic' is not installed, so not removed
Package 'linux-image-5.4.0-33-generic' is not installed, so not removed
Package 'linux-image-unsigned-5.4.0-28-generic' is not installed, so not removed
Package 'linux-image-unsigned-5.4.0-29-generic' is not installed, so not removed
Package 'linux-image-unsigned-5.4.0-31-generic' is not installed, so not removed
Package 'linux-image-unsigned-5.4.0-33-generic' is not installed, so not removed
Package 'linux-image-unsigned-5.4.0-37-generic' is not installed, so not removed
Package 'linux-modules-5.4.0-28-generic' is not installed, so not removed
Package 'linux-modules-5.4.0-29-generic' is not installed, so not removed
Package 'linux-modules-5.4.0-31-generic' is not installed, so not removed
Package 'linux-modules-5.4.0-33-generic' is not installed, so not removed
Package 'linux-modules-extra-5.4.0-28-generic' is not installed, so not removed
Package 'linux-modules-extra-5.4.0-29-generic' is not installed, so not removed
Package 'linux-modules-extra-5.4.0-31-generic' is not installed, so not removed
Package 'linux-modules-extra-5.4.0-33-generic' is not installed, so not removed
Package 'linux-modules-extra-5.4.0-37-generic' is not installed, so not removed
Package 'linux-tools-5.4.0-28-generic' is not installed, so not removed
Package 'linux-tools-5.4.0-29-generic' is not installed, so not removed
Package 'linux-tools-5.4.0-31-generic' is not installed, so not removed
Package 'linux-tools-5.4.0-33-generic' is not installed, so not removed
Package 'linux-tools-5.4.0-37-generic' is not installed, so not removed
Package 'linux-modules-nvidia-390-5.4.0-28-generic' is not installed, so not 
removed
Package 'linux-modules-nvidia-390-5.4.0-29-generic' is not installed, so not 
removed
Package 'linux-modules-nvidia-390-5.4.0-31-generic' is not installed, so not 
removed
Package 'linux-modules-nvidia-390-5.4.0-33-generic' is not installed, so not 
removed
Package 'linux-modules-nvidia-390-5.4.0-37-generic' is not installed, so not 
removed
Package 'linux-modules-nvidia-435-5.4.0-29-generic' is not installed, so not 
removed
Package 'linux-modules-nvidia-435-5.4.0-31-generic' is not installed, so not 
removed
Package 'linux-modules-nvidia-435-5.4.0-33-generic' is not installed, so not 
removed
Package 'linux-modules-nvidia-435-5.4.0-37-generic' is not installed, so not 
removed
Package 'linux-modules-nvidia-440-5.4.0-28-generic' is not installed, so not 
removed
Package 'linux-modules-nvidia-440-5.4.0-29-generic' is not installed, so not 
removed
Package 'linux-modules-nvidia-440-5.4.0-31-generic' is not installed, so not 
removed
Package 'linux-modules-nvidia-440-5.4.0-33-generic' is not installed, so not 
removed
Package 'linux-modules-nvidia-440-5.4.0-37-generic' is not installed, so not 
removed
Package 'linux-buildinfo-5.4.0-38-generic' is not installed, so not removed
Package 'linux-cloud-tools-5.4.0-38-generic' is not installed, so not removed
Package 'linux-cloud-tools-generic' is not installed, so not removed
Package 'linux-cloud-tools-generic-hwe-18.04' is not installed, so not removed
Package 'linux-cloud-tools-generic-hwe-18.04-edge' is not installed, so not 
removed
Package 'linux-cloud-tools-generic-hwe-20.04' is not installed, so not removed
Package 'linux-generic' is not installed, so not removed
Package 'linux-generic-hwe-18.04' is not installed, so not removed
Package 'linux-generic-hwe-18.04-edge' is not installed, so not removed
Package 'linux-generic-hwe-20.04' is not installed, so not removed
Package 'linux-headers-5.4.0-38-generic' is not installed, so not removed
Package 'linux-headers-generic-hwe-18.04' is not installed, so not removed
Package 'linux-headers-generic-hwe-18.04-edge' is not installed, so not removed
Package 'linux-headers-generic-hwe-20.04' is not installed, so not removed
Package 'linux-image-5.4.0-38-generic' is not installed, so not removed
Package 'linux-image-generic' is not installed, so not removed
Package 'linux-image-generic-hwe-18.04' is not installed, so not removed
Package 'linux-image-generic-hwe-18.04-edge' is not installed, so not removed
Package 'linux-image-generic-hwe-20.04' is not installed, so not removed
Package 'linux-image-unsigned-5.4.0-38-generic' is not installed, so not removed
Package 'linux-modules-5.4.0-38-generic' is not installed, so not removed
Package 'linux-modules-extra-5.4.0-38-generic' is not installed, so not removed
Package 'linux-tools-5.4.0-38-generic' is not installed, so not removed
Package 'linux-tools-generic' is not installed, so not removed
Package 'linux-tools-generic-hwe-18.04' is not installed, so not removed
Package 'linux-tools-generic-hwe-18.04-edge' is not installed, so not removed
Package 'linux-tools-generic-hwe-20.04' is not installed, so not removed
Package 'linux-modules-nvidia-390-5.4.0-38-generic' is not installed, so not 
removed
Package 'linux-modules-nvidia-390-generic' is not installed, so not removed
Package 'linux-modules-nvidia-390-generic-hwe-20.04' is not installed, so not 
removed
Package 'linux-modules-nvidia-430-generic' is not installed, so not removed
Package 'linux-modules-nvidia-435-5.4.0-38-generic' is not installed, so not 
removed
Package 'linux-modules-nvidia-435-generic' is not installed, so not removed
Package 'linux-modules-nvidia-435-generic-hwe-20.04' is not installed, so not 
removed
Package 'linux-modules-nvidia-440-5.4.0-38-generic' is not installed, so not 
removed
Package 'linux-modules-nvidia-440-generic' is not installed, so not removed
Package 'linux-modules-nvidia-440-generic-hwe-20.04' is not installed, so not 
removed
The following package was automatically installed and is no longer required:
  linux-headers-5.4.0-37
Use 'apt autoremove' to remove it.
The following packages will be REMOVED:
  linux-headers-5.4.0-37-generic* linux-headers-generic* linux-headers-virtual* 
linux-image-5.4.0-37-generic* linux-image-virtual*
  linux-modules-5.4.0-37-generic* linux-virtual*
0 upgraded, 0 newly installed, 7 to remove and 14 not upgraded.
After this operation, 99.1 MB disk space will be freed.
Do you want to continue? [Y/n] 
(Reading database ... 67679 files and directories currently installed.)
Removing linux-virtual (5.4.0.37.40) ...
Removing linux-headers-virtual (5.4.0.37.40) ...
Removing linux-headers-generic (5.4.0.37.40) ...
Removing linux-headers-5.4.0-37-generic (5.4.0-37.41) ...
Removing linux-image-virtual (5.4.0.37.40) ...
Removing linux-image-5.4.0-37-generic (5.4.0-37.41) ...
W: Removing the running kernel
I: /boot/vmlinuz.old is now a symlink to vmlinuz-5.4.0-1017-kvm
I: /boot/initrd.img.old is now a symlink to initrd.img-5.4.0-1017-kvm
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.4.0-37-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/50-lxd.cfg'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.0-1017-kvm
Found initrd image: /boot/initrd.img-5.4.0-1017-kvm
Adding boot menu entry for UEFI Firmware Settings
done
Removing linux-modules-5.4.0-37-generic (5.4.0-37.41) ...
(Reading database ... 54407 files and directories currently installed.)
Purging configuration files for linux-image-5.4.0-37-generic (5.4.0-37.41) ...
Purging configuration files for linux-modules-5.4.0-37-generic (5.4.0-37.41) ...
root@f1:~# ls -l /boot/
total 20165
-rw------- 1 root root  3034594 Jun 15 12:46 System.map-5.4.0-1017-kvm
-rw-r--r-- 1 root root    83740 Jun 15 12:46 config-5.4.0-1017-kvm
drwxr-xr-x 3 root root      512 Jan  1  1970 efi
drwxr-xr-x 4 root root     4096 Jun 23 17:07 grub
lrwxrwxrwx 1 root root       25 Jun 23 17:06 initrd.img -> 
initrd.img-5.4.0-1017-kvm
-rw-r--r-- 1 root root 11128402 Jun 23 17:06 initrd.img-5.4.0-1017-kvm
lrwxrwxrwx 1 root root       25 Jun 23 17:07 initrd.img.old -> 
initrd.img-5.4.0-1017-kvm
lrwxrwxrwx 1 root root       22 Jun 23 17:06 vmlinuz -> vmlinuz-5.4.0-1017-kvm
-rw------- 1 root root  6392576 Jun 15 12:47 vmlinuz-5.4.0-1017-kvm
lrwxrwxrwx 1 root root       22 Jun 23 17:07 vmlinuz.old -> 
vmlinuz-5.4.0-1017-kvm
root@f1:~# blkid /dev/sda2
/dev/sda2: LABEL="rootfs" UUID="6f205b00-524b-4546-babb-a9b52c4e7ff0" 
TYPE="ext4" PARTUUID="4f8bde89-ee01-4146-87d4-9c556c88e796"
root@f1:~# grep UUID= /boot/grub/grub.cfg 
        linux   /boot/vmlinuz-5.4.0-1017-kvm 
root=UUID=6f205b00-524b-4546-babb-a9b52c4e7ff0 ro  quiet splash console=tty1 
console=ttyS0 $vt_handoff
                linux   /boot/vmlinuz-5.4.0-1017-kvm 
root=UUID=6f205b00-524b-4546-babb-a9b52c4e7ff0 ro  quiet splash console=tty1 
console=ttyS0 $vt_handoff
                linux   /boot/vmlinuz-5.4.0-1017-kvm 
root=UUID=6f205b00-524b-4546-babb-a9b52c4e7ff0 ro single nomodeset 
root@f1:~# poweroff 
root@f1:~# Error: websocket: close 1006 (abnormal closure): unexpected EOF
stgraber@castiana:~$ lxc start --console f1
To detach from the console, press: <ctrl>+a q
RAMDISK: incomplete write (4194304 != 8388608)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.4.0-1017-kvm #17-Ubuntu
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009)/LXD, BIOS 0.0.0 02/06/2015
Call Trace:
 0xffffffff81b2230d
 0xffffffff814a8a21
 0xffffffff8232e5c1
 0xffffffff8232e80f
 0xffffffff8232e976
 0xffffffff8232e274
 ? 0xffffffff81b38a70
 0xffffffff81b38a79
 0xffffffff81c00215
Kernel Offset: 0x400000 from 0xffffffff81000000 (relocation range: 
0xffffffff80000000-0xffffffffbfffffff)
---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on 
unknown-block(0,0) ]---
"""

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux-kvm in Ubuntu.
https://bugs.launchpad.net/bugs/1873809

Title:
  Make linux-kvm bootable in LXD VMs

Status in cloud-images:
  Invalid
Status in linux-kvm package in Ubuntu:
  Triaged
Status in linux-kvm source package in Focal:
  Fix Committed

Bug description:
  The `disk-kvm.img` images which are to be preferred when run under
  virtualization, currently completely fail to boot under UEFI.

  A workaround was put in place such that LXD instead will pull generic-
  based images until this is resolved, this however does come with a
  much longer boot time (as the kernel panics, reboots and then boots)
  and also reduced functionality from cloud-init, so we'd still like
  this fixed in the near future.

  To get things behaving, it looks like we need the following config
  options to be enable in linux-kvm:

   - CONFIG_EFI_STUB
   - CONFIG_VSOCKETS
   - CONFIG_VIRTIO_VSOCKETS
   - CONFIG_VIRTIO_VSOCKETS_COMMON

  == Rationale ==
  We'd like to be able to use the linux-kvm based images for LXD, those will 
directly boot without needing the panic+reboot behavior of generic images and 
will be much lighter in general.

  We also need the LXD agent to work, which requires functional virtio
  vsock.

  == Test case ==
   - wget 
http://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64-lxd.tar.xz
   - wget 
http://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64-disk-kvm.img
   - lxc image import focal-server-cloudimg-amd64-lxd.tar.xz 
focal-server-cloudimg-amd64-disk-kvm.img --alias bug1873809
   - lxc launch bug1873809 v1
   - lxc console v1
   - <check that it boots to login prompt>
   - <disconnect with ctrl+a-q>
   - lxc exec v1 bash

  To validate a new kernel, you'll need to manually repack the .img file
  and install the new kernel in there.

  == Regression potential ==
  I don't know who else is using those kvm images right now, but those changes 
will cause a change to the kernel binary such that it contains the EFI stub 
bits + a signature. This could cause some (horribly broken) systems to no 
longer be able to boot that kernel. Though considering that such a setup is 
common to our other kernels, this seems unlikely.

  Also, this will be introducing virtio vsock support which again, could
  maybe confused some horribly broken systems?

  
  In either case, the kernel conveniently is the only package which ships 
multiple versions concurently, so rebooting on the previous kernel is always an 
option, mitigating some of the risks.

  
  -- Details from original report --
  User report on the LXD side: https://github.com/lxc/lxd/issues/7224

  I've reproduced this issue with:
   - wget 
http://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64-disk-kvm.img
   - qemu-system-x86_64 -bios /usr/share/ovmf/OVMF.fd -hda 
focal-server-cloudimg-amd64-disk-kvm.img -m 1G

  On the graphical console, you'll see EDK2 load (TianoCore) followed by basic 
boot messages and then a message from grub (error: can't find command 
`hwmatch`).
  Those also appear on successful boots of other images so I don't think 
there's anything concerning that. However it'll hang indefinitely and eat up 
all your CPU.

  Switching to the text console view (serial0), you'll see the same
  issue as that LXD report:

  BdsDxe: failed to load Boot0001 "UEFI QEMU DVD-ROM QM00003 " from 
PciRoot(0x0)/Pci(0x1,0x1)/Ata(Secondary,Master,0x0): Not Found
  BdsDxe: loading Boot0002 "UEFI QEMU HARDDISK QM00001 " from 
PciRoot(0x0)/Pci(0x1,0x1)/Ata(Primary,Master,0x0)
  BdsDxe: starting Boot0002 "UEFI QEMU HARDDISK QM00001 " from 
PciRoot(0x0)/Pci(0x1,0x1)/Ata(Primary,Master,0x0)
  error: can't find command `hwmatch'.
  e!!!! X64 Exception Type - 0D(#GP - General Protection)  CPU Apic ID - 
00000000 !!!!
  ExceptionData - 0000000000000000
  RIP  - 000000003FF2DA12, CS  - 0000000000000038, RFLAGS - 0000000000200202
  RAX  - AFAFAFAFAFAFAFAF, RCX - 000000003E80F108, RDX - AFAFAFAFAFAFAFAF
  RBX  - 0000000000000398, RSP - 000000003FF1C638, RBP - 000000003FF34360
  RSI  - 000000003FF343B8, RDI - 0000000000001000
  R8   - 000000003E80F108, R9  - 000000003E815B98, R10 - 0000000000000065
  R11  - 0000000000002501, R12 - 0000000000000004, R13 - 000000003E80F100
  R14  - 0000000000000000, R15 - 0000000000000000
  DS   - 0000000000000030, ES  - 0000000000000030, FS  - 0000000000000030
  GS   - 0000000000000030, SS  - 0000000000000030
  CR0  - 0000000080010033, CR2 - 0000000000000000, CR3 - 000000003FC01000
  CR4  - 0000000000000668, CR8 - 0000000000000000
  DR0  - 0000000000000000, DR1 - 0000000000000000, DR2 - 0000000000000000
  DR3  - 0000000000000000, DR6 - 00000000FFFF0FF0, DR7 - 0000000000000400
  GDTR - 000000003FBEEA98 0000000000000047, LDTR - 0000000000000000
  IDTR - 000000003F2D8018 0000000000000FFF,   TR - 0000000000000000
  FXSAVE_STATE - 000000003FF1C290
  !!!! Find image based on IP(0x3FF2DA12) 
/build/edk2-dQLD17/edk2-0~20191122.bd85bf54/Build/OvmfX64/RELEASE_GCC5/X64/MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.dll
 (ImageBase=000000003FF1E000, EntryPoint=000000003FF30781) !!!!

  If booting in a SecureBoot enabled environment, you instead get a
  `Access Denied` at kernel loading time, indicating that the kernel
  binary isn't a normal signed kernel. That has the same result (boot
  hangs) but without the crash message.

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-images/+bug/1873809/+subscriptions

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to