Vagrant box ubuntu/focal64 dummy output and resize freezes

Bug #1928563 reported by Antoine
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-images
Expired
Undecided
Unassigned

Bug Description

The Canonical official image Ubuntu 20.04 LTS
1.does not has sound (dummy output only in sound settings)
2.VMSVGA display mode in Virtualbox is not working well: a resize of the Windows freezes it.

Here is a reproducible way of the symptoms:
1. Creates a Vagrantfile with this content:
Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/focal64"
  config.vm.box_version = "20210513.0.0"
  config.vm.box_check_update = false
  config.vm.provision "bootstrap", type: "shell" do |s|
    s.inline= <<-'SHELL'
    aptInstall() {
        echo "$(date --iso-8601=s) Installing " "$@" | sudo tee -a /var/log/vagrant_apt.log
        ( time sudo DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt install "$@" -y 2>&1 | sudo tee -a /var/log/vagrant_apt.log ) >/dev/null
    }

    installDesktop() {
        if ! ( dpkg -l ubuntu-desktop ) &>/dev/null ; then
            sudo apt update -y
            aptInstall ubuntu-desktop
            #aptInstall --no-install-recommends ubuntu-desktop
        fi
    }
    installDesktop
    sudo usermod -a -G sudo,vboxsf vagrant
    echo "[INFO] $0 $(id -nu): End of bootstrap shell $(date --iso-8601=s)."
    if test -f /var/run/reboot-required ; then
      echo "Restart needed: /var/run/reboot-required exist."
      sudo cat /var/run/reboot-required
      sudo reboot
    fi
  SHELL
  end

  config.vbguest.auto_update = false

  config.vm.provider "virtualbox" do |v|
    v.gui = true
    v.memory = 2048
    v.cpus = 1
    v.customize ["modifyvm", :id, "--vram", "128"]
    v.customize ["modifyvm", :id, "--graphicscontroller", "vmsvga"]
    v.customize ["modifyvm", :id, "--accelerate3d", "on"]
    v.customize ["modifyvm", :id, "--audioin", "on"]
    v.customize ["modifyvm", :id, "--audioout", "on"]
    v.customize ["modifyvm", :id, "--audiocontroller", "hda"]

  end
end

The cause of all this is because the image misses an important package:
vagrant@ubuntu-focal:~$ sudo dpkg -l|grep linux-modules-
ii linux-modules-5.4.0-73-generic 5.4.0-73.82 amd64 Linux kernel extra modules for version 5.4.0 on 64
 bit x86 SMP
sudo apt install linux-modules-extra-$(uname -r)

Or even better I think, the whole package:
sudo apt install linux-image-generic
that also install linux-modules-extra-$(uname -r)

This fixes both the sound and VMSVGA issue. It misses lots of drivers by default!

If we compare to also official Ubuntu box from Bento (eg https://app.vagrantup.com/bento/boxes/ubuntu-20.04/versions/202012.23.0), their boxes contains linux-image-generic already.

Recommended solution:
rebuild all Ubuntu images with linux-image-generic installed!

These issues are already referenced in:
https://askubuntu.com/questions/1265137/avoid-missing-kernel-linux-modules-extra-xx-generic-when-updating-kernel
https://forums.virtualbox.org/viewtopic.php?f=3&t=102797
https://www.virtualbox.org/ticket/19496

Revision history for this message
Antoine (myroad) wrote :

Probably related to https://bugs.launchpad.net/cloud-images/+bug/1873506 too.

Alternative solution:
Put in documentation of the image https://app.vagrantup.com/ubuntu/boxes/focal64 some indication that, for Virtualbox to properly display with 3D acceleration and with sound, one needs to add:
sudo apt install linux-image-generic

Revision history for this message
Joshua Powers (powersj) wrote :

Hi,

Thanks for taking the time to look into this and file a very detailed bug!

When you use the Bento boxes, do they come with modules-extra as well? Given their size I would not think so. I am going to move this into incomplete for now.

The linux-modules-extra are made available for users, but generally not used by the majority of users. One of the big reasons that linux-modules-extra is not installed by default is the size of the package. The install size of the image once the package is installed is considerably larger (~300MB).

Changed in cloud-images:
status: New → Incomplete
Revision history for this message
Antoine (myroad) wrote :

> When you use the Bento boxes, do they come with modules-extra as well?

Yes, I made sure of that by checking:
vagrant@vagrant:~$ dpkg -l |grep linux-i
ii linux-image-5.4.0-58-generic 5.4.0-58.64 amd64 Signed kernel image generic
ii linux-image-generic 5.4.0.58.61 amd64 Generic Linux kernel image
vagrant@vagrant:~$ dpkg -l |grep linux-mod
ii linux-modules-5.4.0-58-generic 5.4.0-58.64 amd64 Linux kernel extra modules for version 5.4.0 on 64 bit x86 SMP
ii linux-modules-extra-5.4.0-58-generic 5.4.0-58.64 amd64 Linux kernel extra modules for version 5.4.0 on 64 bit x86 SMP

Inside this box
  config.vm.box = "bento/ubuntu-20.04"
  config.vm.box_version = "202012.23.0"

I understand we don't want to increase the size of the image. Should we however move back specific module from extra to linux-modules, like the solution of this ticket https://bugs.launchpad.net/cloud-images/+bug/1873506? That would concerns at least sound (snd-intel8x*.ko but also some module for video I did not identified)

But the less costly solution would be to just document this "issue" in the vagrant page of the box. I consider myself to have some experience in virtualbox and Linux, and it took me days to find out that the box did not include important modules for a normal Desktop experience (sound + resize). The majority of documentation related to no sound in Ubuntu with Virtualbox talks about adding some line in /etc/modprobe/alsa-pulse.conf, or changing AC97 to Intel HDA.

I don't know how much user use the box without graphic, but as soon as we add a desktop, it is absolutely necessary to have these modules.

Revision history for this message
Antoine (myroad) wrote :

For info, bento box is as big as 497 MB.

Revision history for this message
Antoine (myroad) wrote :

While Canonical Ubuntu image is as big as 502 MB!

Revision history for this message
Joshua Powers (powersj) wrote :

wow - thanks for calling that out

https://app.vagrantup.com/bento/boxes/ubuntu-20.04
Shows the virtual-box image at 487MB

https://cloud-images.ubuntu.com/focal/current/
Shows our virtual-box image at 503MB

Can you launch the bento box and get `dpkg -l` and `snap list` for me, please?

Revision history for this message
Antoine (myroad) wrote :

For this image:
  config.vm.box = "bento/ubuntu-20.04"
  config.vm.box_version = "202012.23.0"
Without guest additions installed:

vagrant@vagrant:~$ snap list
No snaps are installed yet. Try 'snap install hello-world'.

vagrant@vagrant:~$ dpkg -l | wc -l
564

Full dpkg -l attached.

Revision history for this message
Antoine (myroad) wrote :

While for
  config.vm.box = "ubuntu/focal64"
  config.vm.box_version = "20210513.0.0"

vagrant@ubuntu-focal:~$ snap list
Name Version Rev Tracking Publisher Notes
core18 20210309 1997 latest/stable canonical✓ base
lxd 4.0.6 20326 4.0/stable/… canonical✓ -
snapd 2.50 11841 latest/stable canonical✓ snapd

vagrant@ubuntu-focal:~$ dpkg -l | wc -l
566

Full dpkg -l attached.

Revision history for this message
Joshua Powers (powersj) wrote :

Hey! Thanks for getting those lists. There do seem to be quite a difference between the two, more than just the one package, which can explain why the sizes are still similar.

Given that the use case for these images is not primarily for general desktop usage, I still do not think we would add the package by default.

Let me see about a better way to document this though!

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for cloud-images because there has been no activity for 60 days.]

Changed in cloud-images:
status: Incomplete → Expired
Revision history for this message
Antoine (myroad) wrote :

Up! It shouldn't be too difficult to write a small doc in vagrant page :)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.