Vagrant box startup timeout due to no serial port

Bug #1829625 reported by bugrasan
96
This bug affects 16 people
Affects Status Importance Assigned to Milestone
cloud-images
Confirmed
Undecided
Unassigned
livecd-rootfs (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

due to this issue the boot time of ubuntu 19.04 (disco) requires about 2minutes on my systems instead of about 5-7 seconds.

environment:
* ubuntu 18.04
* vagrant v2.0.2
* virtualbox 6.0.8

steps to reproduce:
1) initialize vagrant: `vagrant init ubuntu/disco64`
2) start vagrant image: `vagrant up`

get the virtual machine name or uuid, and read the 'uartmode1' setup:
`VBoxManage showvminfo <uuid|vmname> --machinereadable |grep ^uart`
will result in:
----
uart1="0x03f8,4"
uartmode1="disconnected"
uarttype1="16550A"
uart2="off"
uart3="off"
uart4="off"
----

with 'uartmode1' disconnected, meaning 'ttyS0' not attached to the vm ubuntu 19.04 will take a long time to boot.

with previous ubuntu versions this works fine, e.g. cosmic64 or bionic64.

----
uart1="0x03f8,4"
uartmode1="file,/somedir/vagrant-test-cosmic64/ubuntu-cosmic-18.10-cloudimg-console.log"
uarttype1="16550A"
uart2="off"
uart3="off"
uart4="off"
----

if the ttyS0 should no longer be attached by default then the grub parameter 'GRUB_CMDLINE_LINUX_DEFAULT' in '/etc/default/grub.d/50-cloudimg-settings.cfg' needs to be adjusted from:
GRUB_CMDLINE_LINUX_DEFAULT="console=tty1 console=ttyS0"
to
GRUB_CMDLINE_LINUX_DEFAULT="console=tty1"

the impact is best visible when the vm is started with a gui, either from virtualbox gui or with vagrant in 'Vagrantfile':
----
   config.vm.provider "virtualbox" do |vb|
     # Display the VirtualBox GUI when booting the machine
     vb.gui = true
   end
----

tags: added: id-5cf13913704f6332da576e60
Revision history for this message
Konrad (kan-kaiko) wrote :

I've experienced the same problem with focal64 image. Is it going to be fixed?

Revision history for this message
Dale Hamel (daleha-gmail) wrote :

This is also an issue on ubuntu eoan with virtualbox. A workaround is to modify the config to pipe this to a file:

  config.vm.provider 'virtualbox' do |v|
    v.customize ["modifyvm", :id, "--uart1", "0x3F8", "4"]
    v.customize ["modifyvm", :id, "--uartmode1", "file", "./ttyS0.log"]
  end

Revision history for this message
vhasby65782 (vhasby65782) wrote :

This bug was introduced by LP # 1777827.

I suggest changing to:

    v.customize ["modifyvm", :id, "--uartmode1", "file", File::NULL]

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

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in livecd-rootfs (Ubuntu):
status: New → Confirmed
affects: livecd-rootfs → livecd-rootfs (Ubuntu)
Changed in livecd-rootfs (Ubuntu):
status: New → Confirmed
Changed in cloud-images:
status: New → Confirmed
tags: added: focal
summary: - disco64 vagrant box slow boot due to missing ttyS0 (uartmode1 not set to
- a log file in virtualbox)
+ Vagrant box startup timeout due to no serial port
tags: removed: id-5cf13913704f6332da576e60
tags: added: id-5cf13913704f6332da576e60
Revision history for this message
Alejandro Torras (atec-post) wrote :

Current version of eoan64 (20200422.0.0) and this final config, from contributions of #2 and #3, it seems to boot "fast" (with a minor reset in between) again:

  config.vm.provider "virtualbox" do |vb|
     # Display the VirtualBox GUI when booting the machine
     # vb.gui = true

     # Customize the amount of memory on the VM:
     vb.memory = "1024"

     vb.customize ["modifyvm", :id, "--uart1", "0x3F8", "4"]
     vb.customize ["modifyvm", :id, "--uartmode1", "file", File::NULL]

     vb.customize ["modifyvm", :id, "--nestedpaging", "off"]
     vb.customize ["modifyvm", :id, "--cpus", 4]
     vb.customize ["modifyvm", :id, "--paravirtprovider", "hyperv"]

   end

Revision history for this message
Bert Driehuis (driehuis) wrote :

I suspect the partyline is that cloudimage shall support serial console come hell or high water. If that's the case, as an alternative to modifying cloudimage to suite vagrant, it might make sense to petition vagrant to provide a sensible default for the serial console to suit cloudimage.

I ran into this with vagrant 2.2.9 and Ubuntu focal64.

If the cloudimage team can enlighten us about the rationale for requesting ttyS0 I'll be happy to do the legwork with vagrant.

Revision history for this message
Craig Maloney (craig-decafbad) wrote :

This issue bit me yesterday. The fix provided in for the Vagrantfile in comment 5 worked. This is incredibly frustrating to realize, though I think the issue is more with the vagrant folks not having the serial port. Is there a way to coordinate to fix this?

I'll also note that generic/ubuntu2004 doesn't seem to have this issue, so perhaps making the Vagrant images not require the serial port would be an approach?

Revision history for this message
Sergey Gavrilov (gavrilov-srg) wrote :

Скопируйте? то что написал Alejandro Torras (#5) и вы сможете решить эту проблему.

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.