vm-new fails when no display is available

Bug #967816 reported by Max Brustkern
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Tools used by the Ubuntu QA Team
Fix Released
Undecided
Unassigned

Bug Description

On Oneiric amd64 desktop, with DISPLAY not properly set, if I run:
./vm-new -f -r -b virbr0 -t server oneiric i386 test
in the vm-tools directory on revision 787, virt-install runs and begins the vm initialization process, but immediately exits when it cannot display the console due to the lack of an X server. The script then continues up to vm-cmd, which runs vm_wait and waits for the vm to come up. Unfortunately, when the installer finishes, the vm halts instead of rebooting, and vm-cmd has already detected it as running, it will not try to start it again.

Revision history for this message
Max Brustkern (nuclearbob) wrote :

I've attached a patch that adds --noautoconsole to the list of virt-install options, then waits 30 minutes for VM to finish installation and shut down before proceeding. Please let me know if this is a reasonable solution.

Revision history for this message
Max Brustkern (nuclearbob) wrote :

Here is a better patch that uses vm_running from libvm.sh.

Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

I like seeing the progress of my vm installation. How about detecting if DISPLAY is missing and only then adding --noautoconsole? Or it could be an extra command line option...something like vm-new -h for "headless"...

Changed in ubuntu-qa-tools:
status: New → Incomplete
Revision history for this message
Max Brustkern (nuclearbob) wrote :

Here is a new patch which only adds --autoconsole to the arguments when $DISPLAY is empty. -h currently displays the help info, but I can implement that on another letter if that's desirable.

Revision history for this message
Max Brustkern (nuclearbob) wrote :
Revision history for this message
Max Brustkern (nuclearbob) wrote :

My previous patch called local outside of a function, which works in bash but not in dash. The attached version corrects that.

Revision history for this message
Max Brustkern (nuclearbob) wrote :

I've added a -v option that invokes the option regardless of the contents of $DISPLAY.

Revision history for this message
Max Brustkern (nuclearbob) wrote :
Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

ACK on the patch. Commited. Thanks!

Changed in ubuntu-qa-tools:
status: Incomplete → Fix Released
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.