You are not logged in.

#1 2013-01-06 13:58:35

x-yuri
Member
Registered: 2013-01-06
Posts: 157

[SOLVED] virtualbox/uefi: change console resolution

I've installed Arch Linux (x86_64, UEFI, GPT) on VirtualBox 4.2.6. But I'm stuck with linux switching to 1024x768 mode. As a result guest OS doesn't fit the window and scrollbars appear. Here's what dmesg shows:

[    0.000000] Console: colour dummy device 80x25
...
[    0.332371] efifb: probing for efifb
[    0.332598] efifb: framebuffer at 0x80000000, mapped to 0xffffc90000100000, u
sing 6144k, total 2113535k
[    0.332599] efifb: mode is 1024x768x32, linelength=4096, pages=1
[    0.332600] efifb: scrolling: redraw
[    0.332602] efifb: Truecolor: size=8:8:8:8, shift=24:16:8:0
[    0.341566] Console: switching to colour frame buffer device 128x48
[    0.346584] fb0: EFI VGA frame buffer device

Here's what lspci tell's about guest's videocard:

[yuri@tarch ~]$ lspci
00:02.0 VGA compatible controller: InnoTek Systemberatung GmbH VirtualBox Graphics Adapter

lspci -k indicates that no driver handles this device (is this ok?).

The closest discussion I've managed to find on the net is this one. But OP there has Intel videocard, he isn't running linux under VM and the way he solved the issue doesn't work for me. I've tried passing parameters to the kernel (nomodeset, video=640x480, vga=ask, vga=normal, vga=0x101), to no avail. Passing video=efifb:640x480 makes boot process stuck after refind prints "Using load options 'vmlinux-arch.efi root=...'". As far as I can tell vga parameter isn't applicable to 64-bit linux kernel.

And why does the kernel chooses efifb in the first place? Documentation says:

This is a generic EFI platform driver for Intel based Apple computers.
efifb is only for EFI booted Intel Macs.

Last edited by x-yuri (2013-01-29 19:34:37)

Offline

#2 2013-01-06 14:00:53

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,592
Website

Re: [SOLVED] virtualbox/uefi: change console resolution

You want guest additions which fixes this I believe.  Pacman -Ss virtualbox


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3 2013-01-06 14:29:06

x-yuri
Member
Registered: 2013-01-06
Posts: 157

Re: [SOLVED] virtualbox/uefi: change console resolution

As far as I can tell, installing Guest Additions makes sense if you're going to use X Server. It's not my case, nevertheless I've installed them and made its modules loaded at boot. Still with no result.

Offline

#4 2013-01-06 20:23:18

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: [SOLVED] virtualbox/uefi: change console resolution

I'm not entirely sure what's causing your problem, but with my VirtualBox installations (version 4.1.22 under Gentoo), the framebuffer size is set before the kernel gains control, and the kernel doesn't seem to be able to adjust it. You can set the default mode by using commands like these:

VBoxManage setextradata "VM name" VBoxInternal2/EfiGopMode 2
VBoxManage setextradata "VM name" VBoxInternal2/UgaHorizontalResolution 1024
VBoxManage setextradata "VM name" VBoxInternal2/UgaVerticalResolution 768

See this page for details, including what the different GOP modes are.

I generally find it easier to use the "resolution" token in rEFInd's refind.conf file. GRUB 2 has something similar: It's the GRUB_GFXMODE option in /etc/default/grub, at least on a Fedora 18 installation. (I'm not sure if Arch's package uses the same filename or option name.) In the case of GRUB, you'd need to regenerate your grub.cfg file for the change to take effect, but rEFInd reads refind.conf at boot time, so you could just change it there and be done with it. In either case, you can just set a mode in the configuration file within the virtual machine rather than adjust it with obscure commands in the host OS.

Until recently, most Linux X installations have used the EFI framebuffer device when VirtualBox has booted in EFI mode. My last few installs, though, have begun using the VirtualBox driver. I'm guessing this driver didn't work in EFI mode until recently, but now it does. Now when I switch between X and text mode, the VirtualBox screen changes size, but I don't get scroll bars unless one of the modes is set too large for my host OS's display. I can still force it to use the EFI framebuffer driver if I like by generating an /etc/X11/xorg.conf file and setting that file to use the framebuffer driver.

As for the EFI framebuffer device being for Macs, I believe the documentation is simply outdated.

Offline

#5 2013-01-06 20:33:09

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,592
Website

Re: [SOLVED] virtualbox/uefi: change console resolution

x-yuri wrote:

As far as I can tell, installing Guest Additions makes sense if you're going to use X Server. It's not my case, nevertheless I've installed them and made its modules loaded at boot. Still with no result.


Why not run in headless mode and use ssh for interaction?


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#6 2013-01-07 01:39:01

x-yuri
Member
Registered: 2013-01-06
Posts: 157

Re: [SOLVED] virtualbox/uefi: change console resolution

srs5694 wrote:

You can set the default mode by using commands like these

EfiGopMode does works smile except for value 0 though. Although as per refind's documention it (0) specifies default resolution (1024x768 in my case). So it's likely to be expected. And Uga*Resolution does not. There is probably some reason behind efifb being described as Mac driver...

In fact, I remember I saw this options in the manual not that long ago.

srs5694 wrote:

I generally find it easier to use the "resolution" token in rEFInd's refind.conf file.

Well, it works too smile I've even managed to set resolution to 640x480.

graysky wrote:

Why not run in headless mode and use ssh for interaction?

In truth, that's what I'm going to do. I just stumbled across this annoyance and couldn't help myself but find out how to fix it smile

Thanks for your help guys. I've spent a lot of time trying to make it work. It would be sad to see it go to waste...

Last edited by x-yuri (2013-01-07 01:40:36)

Offline

#7 2013-01-19 04:05:25

x-yuri
Member
Registered: 2013-01-06
Posts: 157

Re: [SOLVED] virtualbox/uefi: change console resolution

It appears rEFInd ignores refind_linux.conf.

Offline

#8 2013-01-19 17:07:07

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: [SOLVED] virtualbox/uefi: change console resolution

First, note that I maintain rEFInd.

The refind_linux.conf file is not relevant to setting the EFI framebuffer mode; that detail is set via the "resolution" and/or "textmode" options in the refind.conf file -- note that those two files are not equivalent.

More broadly speaking, the claim that rEFInd ignores refind_linux.conf is overly-broad at best. Many people use that file successfully. You've linked to one thread that claims rEFInd was ignoring the file. In that thread, I offered some hypotheses about why that was happening, but the OP didn't post back with a resolution that would enable positive identification of the actual cause. As I stated in that thread, I suspect the problem is either filesystem damage or a refind_linux.conf file that's in an improper format. In neither of those cases is this a rEFInd problem; it's a problem with the filesystem or file, or perhaps in the EFI itself. That said, it's conceivable that there is a bug in rEFInd that's causing it to ignore a valid refind_linux.conf file under certain circumstances -- but if so, the problem is pretty rare, and I can't fix a problem that I can't reproduce without help from those who do have the problem. This is true of any software developer, and it's the reason that bug reports and interactions with developers about problems are important -- if you have a problem, it might not get fixed if you don't report it. Even just reporting it may not be enough; you may need to perform additional diagnostics and try out test programs to help the developer fix the problem.

Offline

#9 2013-01-25 16:38:53

x-yuri
Member
Registered: 2013-01-06
Posts: 157

Re: [SOLVED] virtualbox/uefi: change console resolution

Sorry for the delay. I can't confirm what I was saying before for some reason. I based my judgement on inability to choose between menu items, specified in refind_linux.conf. But now I can. It appears on pressing F2.

Offline

Board footer

Powered by FluxBB