View previous topic :: View next topic |
Author |
Message |
Tractor Girl Apprentice
Joined: 16 May 2013 Posts: 159
|
Posted: Sun Mar 23, 2014 2:45 pm Post subject: Qemu console resolution and ssh access to guest |
|
|
Is there a way to change the resolution of guest's system console (tty) inside qemu?
I know I can change guest's X resolution using /etc/X11/xorg.conf, but what if I want to run just X-less guest with decent resolution.
Last edited by Tractor Girl on Thu Mar 27, 2014 2:31 pm; edited 1 time in total |
|
Back to top |
|
|
miket Guru
Joined: 28 Apr 2007 Posts: 488 Location: Gainesville, FL, USA
|
Posted: Tue Mar 25, 2014 1:14 am Post subject: |
|
|
I should try it out to be sure, but I'm betting that to get a bigger window of a guest's framebuffer console, you'd enter on the kernel's command line whatever the size parameters are for the virtualized hardware. Of course, before you can even get this far, you have to have enabled the appropriate framebuffer support in the kernel and pass in the appropriate command-line option to qemu.
This would be in either the bootloader or via the -append switch to QEMU (if you start QEMU using the -kernel parameter). For the default Cirrus card, that would be something like this in grub Code: | kernel /boot/kernel-3.10.0 root=/dev/sda1 mode:1024x768 | or at the qemu command like Code: | -append "root=/dev/sda1 mode:1024x768" |
(Again I hadn't tried this to be sure, either with real or with emulated Cirrus hardware. The Cirrus framebuffer documentation in the kernel sources leads me to think it's not "video=mode:1024x768", though the video= part seems perfectly plausible.)
If you're using one of the other alternatives (std, vmware, or qxl), you'd need to do a kernel setup for a VESA-compatible controller or some more specialized driver if you can find one.
Generally, though, I prefer to set it up so that I can ssh into a guest and be able to resize the terminal window to whatever I'd like. Doing that would save you from having to add framebuffer support to your guest kernel. So--no X, no framebuffer, and no delays from having to emulate a video controller. |
|
Back to top |
|
|
Tractor Girl Apprentice
Joined: 16 May 2013 Posts: 159
|
Posted: Thu Mar 27, 2014 2:16 am Post subject: |
|
|
Great!
Thank You |
|
Back to top |
|
|
vaxbrat l33t
Joined: 05 Oct 2005 Posts: 731 Location: DC Burbs
|
Posted: Thu Mar 27, 2014 5:28 am Post subject: grub2 might have it in /etc/default/grub |
|
|
If you are using grub2 for the boot loader and haven't forced it into text or vga console by futzing with the other defaults there's a resolution setting you can uncomment and set in /etc/default/grub
Code: | #GRUB_GFXMODE=640x480
|
That will take the next time you do a grub2-mkconfig. Some googling suggests that this may be risky with nvidia framebuffers and the nvidia-driver. I'm also not so sure about grub2 maybe being hoggish with the console if you want to do some sort of interactive thing with an initramfs init script. |
|
Back to top |
|
|
Tractor Girl Apprentice
Joined: 16 May 2013 Posts: 159
|
Posted: Thu Mar 27, 2014 2:26 pm Post subject: |
|
|
Code: | GRUB_GFXMODE=1024x768 |
When I set this, grub spash screen is in desired resolution but next, when system is actually booting, it's switches back to the old resolution
How should I start qemu to be able to ssh into guest system?
Man says that -redir option is deprecated, and it doesn't seem to work for me. Also should I run qemu with -nographic or -curses for ssh-only access?
=================================================================
EDIT:
ok I managed to connect to guest system like this:
Code: | qemu-kvm -m 1024 -hda guest.img -nographic -redir tcp:33333::22 |
Code: | ssh -p 33333 guest_user@localhost |
Still man says:
Quote: | Note: Legacy stand-alone options (...) -redir are still processed and
applied to -net user. Mixing them with the new configuration syntax gives undefined
results. Their use for new applications is discouraged as they will be removed from future
versions |
How should this "new" syntax looks like? |
|
Back to top |
|
|
|