Setting the Resolution in an X-less VM

Ever been working in a VM that is command line only and wished it wasn’t so small? Well, that was how I felt constantly until now. Step on past the break to see how to change the resolution in an X-less install by utilizing uvesafb.

Let’s look at this from two points of view: Ubuntu and Gentoo.

Ubuntu with Grub2:

First, we are assuming that you want to make your window 1024x768-24... adjust as you see fit.

Install v86d so you can get uvesafb:

gene@ubuntu01:~$ sudo apt-get install v86d

Edit /etc/default/grub so that the lines referenced below are changed:

...
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset video=uvesafb:mode_option=1024x768-24,mtrr=3,scroll=ywrap"
...
GRUB_GFXMODE=1024x768

Now add the following to /etc/initramfs-tools/modules:

uvesafb mode_option=1024x768-24 mtrr=3 scroll=ywrap

Now we need to force the use of the framebuffer:

gene@ubuntu01:~$ echo FRAMEBUFFER=y | sudo tee /etc/initramfs-tools/conf.d/splash

Lastly we need to apply these changes and reboot:

gene@ubuntu01:~$ sudo update-grub2
gene@ubuntu01:~$ sudo update-initramfs -u
gene@ubuntu01:~$ sudo reboot

Gentoo:

I could reinvent the wheel here... or I can just let Spock, the author of uvesafb, tell us how this is done at http://dev.gentoo.org/~spock/projects/uvesafb/

That's it. I hope you enjoy having a little more real estate in your command line only VM's.

______________________

Gene Liverman is a Systems Administrator of *nix and VMware at a university.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

more simple approach

Hans-Werner's picture

Well, I prefer doing this either via a (virtual) network based login (SSH, or if you mind the CPU overhead, telnet on a dedicated subnetwork) or via serial port emulation (which will provide you with e.g. a PTY to connect to).

Setting up graphics (even though it's just a framebuffer, not full X) just feels so wrong for this... But the article might fit some other usage scenario, e.g. if you absolutely want to use that fancy VM frontend which happens to display framebuffer output, whether X is running or not... So see this just as a small reminder that even VMs might provide more user interfaces than the (emulated) graphics output.

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState