TurnKey Linux Virtual Appliance Library

How to set text console on first serial port?

I would like to capture the output of the installer to a file.

I use virt-install to install an appliance on my server.  According to the man page:

 --nographics
   No graphical console will be allocated for the guest. Fully virtualized 
   guests will need to have a text console configured on the first serial 
   port in the guest (this can be done via the --extra-args option)

I tried this command:

virt-install -n v1092 -r 512 --vcpus=1 --check-cpu --os-type=linux --os-variant=ubuntuhardy 
-v --accelerate -c /tmp/turnkey-lamp-2009.10-hardy-x86.iso 
-f /var/lib/libvirt/images/v1092.img -s 15 -b br0 --nographics -x "console ttyS0"

I get this output:

Starting install...
Creating domain... 

Connected to domain v1092
Escape character is ^]

And then it just sits there doing nothing.

Any ideas on how I can do this?

Thanks,
  Neil

Liraz Siri's picture

What are you trying to accomplish?

I feel I'm probably not understanding what you are trying to do. I've used KVM before in my testing but not via libvirt. As you probably realize the ISO installation is interactive so how do you complete installation if you disable the console?

If you're trying to automate installation you might want to try a different direction such wrapping around tklpatch to extract the filesystem from the ISO and then applying changes as required.

Not trying to disable the console

I am not trying to disable the console, just tell it to use text mode instead of graphical mode and to interact on ttyS0.

Is that possible?

http://UnmeteredVPS.net/tkl
Try our TurnKey Linux appliance hosting FREE!

Liraz Siri's picture

Ah I think I know what you're trying to do + a couple of tips

I'm guessing you are trying to figure out how to let your users go through the installation process themselves. If you can make it work that would be pretty neat!

A couple of tips:

  1. Use qemu directly while you are experimenting. It's more low level than libvirt which may be making some options harder to access.
  2. I think gfxboot may be getting in your way though if the virtual serial console you are connecting doesn't support that graphics mode. Perhaps you should try tweaking the bootloader's configuration parameters to try and make it use text mode. Look in cdroot/isolinux/isolinux.cfg.

Investigating

I think you are correct that gfxboot interferes with what I am doing.  I will investigate how to edit the bootloader config to tell it to use a text console.  Thanks for the pointer.

Regarding what I am doing, I am playing around with a few ideas.  If I can figure out how to get a working serial console, I am pretty sure something like ShellInABox can connect to it.  Lets see where this investigation goes, you never know what you end up with when you start!

http://UnmeteredVPS.net/tkl
Try our TurnKey Linux appliance hosting FREE!

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)