How to change resolution of CentOS 6.5 Resolution on virtualbox (Host: Win7)

26,163

Solution 1

A co-worked found a solution to this problem. It would be hard to pinpoint all the environment settings changed since I first got the VM, but hopefully this will be enough:

  1. Have guest additions installed (for either Virtualbox or VMware, whatever you're using).
  2. DELETE the file /etc/X11/xorg.conf (or to be safer, mv it to /etc/X11/xorg.conf.unused or something)

This opened up a huge range of resolutions for me, and among them 1920 x 1080. Hopefully this helps other people too.

Solution 2

More steps to add 1920x1080 Screen resolution. Just make sure that you "reboot" after you uncomment X11's xorg.conf file before you run the automated scripts further down below.

sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.unused

You can use the following scripts. Also credit to Adam Prax's Answer How to change resolution of CentOS 6.5 Resolution on virtualbox (Host: Win7)

#!/bin/bash
Diplay_Name=`xrandr | grep connected | cut -d' ' -f1`
Display_Spec=`cvt 1920 1080 | grep Modeline | cut -d' ' -f2 |cut -d '"' -f2`
Display_Params=`cvt 1920 1080 | grep Modeline | cut -d' ' -f2-18`
xrandr --newmode $Display_Params
xrandr --addmode $Diplay_Name $Display_Spec
xrandr --output $Diplay_Name --mode $Display_Spec

You should have something commands execution like below.

xrandr --newmode "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync 
xrandr --addmode VGA-0 1920x1080_60.00 
xrandr --output VGA-0 --mode 1920x1080_60.00

Then, you can use VirtualBox’s “View -> Auto-resize Guest Display” to let VirtualBox automatic resize work for you.

Solution 3

For me (CentOS 7 on VirtualBox 4.3.10 with Guest Additions 4.3.18), the answer provided by Ray Sheu nearly worked.

I only had to change the definition of Display_Params to also remove the double quotes around the mode name:

Display_Params=`cvt 1920 1080 | grep Modeline | cut -d' ' -f2-18 | sed s/'"'//g`

I also had set the screen size hint of 1920x1080 as described in the answer by Devon Parsons, but that alone did not help. I did not check out whether that was necessary at all.

Share:
26,163

Related videos on Youtube

Devon Parsons
Author by

Devon Parsons

SOreadytohelp

Updated on September 18, 2022

Comments

  • Devon Parsons
    Devon Parsons over 1 year

    So I'm trying to configure the resolution of my CentOS 6.5 virtualbox. Here are the steps I have taken:

    Installed guest additions
    Changed virtualbox preferences > Display > Maximum Guest Screen Size: Hint (Width 1920, height 1080)
    Restarted VirtualBox System > Preferences > Display only shows 1024x768 and lower as possible resolutions.

    I had also tried editing /etc/X11/xorg.conf to include the following:

    Section "Screen" Depth 24 SubSection "Display" Depth 24 Modes "1920x1080" EndSubSection EndSection

    However changing this caused box to crash to a black window with "CentOS 6.5" printed. It would let me type but would not let me run commands; hitting enter returned a newline but no actions. There was no prompt.

    I've also seen instructions to run a command changing the MaxGuestOSResolution (or something) in my host terminal, but I'm hosting on windows so that isn't an option.

    Is there something I'm overlooking? I've done a lot of google searching but nothing has given me the option to increase the resolution. I've also taken a couple steps that I didn't list here, but I can't remember them all.

    Thanks in advance.

    • Nathan C
      Nathan C almost 10 years
      Virtualbox guest additions installed too? There's a graphics driver attached to that.
    • Devon Parsons
      Devon Parsons almost 10 years
      @NathanC how do I manipulate that driver? I haven't seen any settings that would help me but I might be looking in the wrong places.
    • Nathan C
      Nathan C almost 10 years
      Once you install the actual extensions (using the menu) and reboot the VM, they'll automatically be enabled. Also make sure you're allocating enough video memory to the VM for a high resolution (I normally max it out unless it's a server).
    • Devon Parsons
      Devon Parsons almost 10 years
      @NathanC I have allocated 128mb for the vm video memory, which is the max vbox allowed. And I have rebooted the VM since installing vbox guest additions, but like I said it did not give me any more options for resolution. Is there somewhere for me to check the driver settings? I'm unfamiliar with CentOS.
    • Nathan C
      Nathan C almost 10 years
      It sounds like you may be out of luck ...CentOS 6.x doesn't like the drivers that come with virtualbox it seems.
    • Devon Parsons
      Devon Parsons almost 10 years
      @NathanC if I used a different VM, such as VMWare player, would that potentially help?
    • Nathan C
      Nathan C almost 10 years
      Maybe. Fedora is the desktop-friendly version of Redhat if you like that range of distros.
    • MonkeyZeus
      MonkeyZeus almost 10 years
      I've faced this exact issue before and I bookmarked the site(s) which helped me out but unfortunately that's on my home PC so if no one else answers then I can get those to you in a few hours.
  • Niklas Rosencrantz
    Niklas Rosencrantz about 7 years
    Doesn't work with CentOS 7