# Hyper-V: Change the screen resolution in a CentOS or RHEL virtual machine

*2016-02-05*

> Change the screen resolution of a CentOS or RHEL virtual machine in Hyper-V using grubby to configure the hyperv_fb framebuffer driver.

I was considering switching back to GNU/Linux as my desktop OS. My previous stint with GNU/Linux lasted five years before I returned to Windows. This time, I decided to try CentOS 7, whose long support lifecycle made it appealing for a development machine.

Before committing to the switch, I wanted to see how the distribution worked out of the box and test the development tools and applications I needed. I installed CentOS 7 in a Hyper-V virtual machine.

After installation, the display resolution was set to 1152×864. I couldn't change it through either KDE System Settings or the Hyper-V virtual machine settings.

After some digging, I learned that the Hyper-V framebuffer driver accepts a screen resolution through a kernel boot parameter. CentOS provides `grubby` for managing boot entries, so I could set the parameter without editing `grub.cfg` manually.

To set the resolution, open a terminal inside the virtual machine and switch to the root account:

```sh
su -
```

Then set the desired resolution and reboot:

```sh
grubby --update-kernel=ALL --args="video=hyperv_fb:1280x1024"
reboot
```

Replace `1280x1024` with the resolution you want to use. The `--update-kernel=ALL` option updates the boot arguments for all existing kernel entries. The new resolution takes effect after the virtual machine reboots.

These steps describe my CentOS 7 setup. For a later RHEL example, see Red Hat's [guide to changing the Hyper-V screen resolution in RHEL 8](https://developers.redhat.com/articles/2021/09/30/better-screen-resolution-hyper-v-rhel-8).

For more information about the command's options, run `man grubby`.

