Software & AppsOperating SystemLinux

How To Set Up Dynamic Screen Sizing for a QEMU Windows 10 Guest on Ubuntu 18.04?

Ubuntu 18

In this article, we will guide you through the process of setting up dynamic screen sizing for a Windows 10 guest on Ubuntu 18.04 using QEMU. This will allow your virtual machine’s display to automatically adjust to the size of the window, providing a more seamless user experience.

Quick Answer

Yes, it is possible to set up dynamic screen sizing for a QEMU Windows 10 guest on Ubuntu 18.04. By following the steps outlined in this guide, you can configure your virtual machine’s display to automatically adjust to the size of the window, providing a more seamless user experience.

Prerequisites

Before we begin, ensure that you have the following:

  • A Ubuntu 18.04 host machine.
  • A Windows 10 guest machine set up using QEMU.

Step 1: Installing virt-manager

Firstly, we need to install virt-manager on your Ubuntu host machine. virt-manager is a desktop user interface for managing virtual machines. You can install it by running the following command in your terminal:

sudo apt install virt-manager

Step 2: Setting Up a Group

Next, we need to set up a group to use virt-manager without sudo. This can be achieved by running the following commands in the terminal:

sudo groupadd --system libvirt
sudo usermod -a -G libvirt $(whoami)
su - $USER

The groupadd command creates a new group. The --system option creates a system group. The usermod command modifies the system account, and the -a -G options add the user to the supplementary group(s). $(whoami) returns the current user, and su - $USER logs in as that user.

Step 3: Configuring virt-manager

Start virt-manager and navigate to View -> Edit -> Preferences -> Console. Here, activate the option “Resize guest with window: On”. This will allow the guest machine’s display to automatically adjust to the size of the window.

Step 4: Creating a New Virtual Machine

Use the icon on the top left to “Create a new virtual machine”. Choose “Import existing disk image”. Then, select the appropriate OS type and version, and specify the path to your Windows partition (e.g., /dev/nvme0n1).

Step 5: Customizing Configuration

Proceed through the setup process, making sure to check “Customize configuration before install”. In the customization window, choose Firmware: UEFI x86_64: /usr/share/OVMF/OVMF_CODE.fd (assuming you have it installed).

By default, the disk will be added as an “IDE Disk”. If you prefer to use virtio, add a second disk (small size) backed by a file and set its disk bus type to virtio. You can remove it after installing the virtio guest tools in the guest.

Step 6: Installing Guest Tools

Click “Begin Installation” to start the process. This will not affect your installed Windows system. Once the installation is complete, install the QEMU Guest Tools and the SPICE Guest Tools in the guest. You may also need to install the virtio guest tools from the virtio-win-pkg-scripts repository.

Step 7: Finalizing the Setup

Reboot the guest. If everything works, you can remove the temporary disk and change the NIC to virtio as well. In the VM machine, go to View -> Scale Display -> Auto resize VM with window.

By following these steps, you should be able to achieve dynamic screen resizing and have a single window for your Windows 10 guest that adapts well to being resized.

Conclusion

Setting up dynamic screen sizing for a QEMU Windows 10 guest on Ubuntu 18.04 might seem like a complex task, but with this guide, we hope to have made the process more straightforward. Remember to follow each step carefully, and you should have a more seamless and user-friendly virtual machine experience in no time.

What is QEMU?

QEMU is an open-source virtualization software that allows you to run operating systems and applications on a host machine without the need for dedicated hardware.

Can I use QEMU to run Windows 10 on Ubuntu 18.04?

Yes, you can use QEMU to run Windows 10 on Ubuntu 18.04. QEMU provides virtualization capabilities that allow you to create and manage virtual machines running different operating systems, including Windows 10.

What is `virt-manager`?

virt-manager is a desktop user interface for managing virtual machines. It provides a graphical interface to create, configure, and manage virtual machines on your host machine.

Do I need to install `virt-manager` to set up dynamic screen sizing?

Yes, you need to install virt-manager on your Ubuntu host machine to set up dynamic screen sizing for a QEMU Windows 10 guest. virt-manager provides the necessary tools and options to configure the guest machine’s display.

How do I install `virt-manager` on Ubuntu 18.04?

To install virt-manager on Ubuntu 18.04, open a terminal and run the command sudo apt install virt-manager. This will install virt-manager and its dependencies on your system.

Can I resize the guest machine’s display manually?

Yes, you can manually resize the guest machine’s display by going to View -> Scale Display in the virt-manager interface. However, setting up dynamic screen sizing allows the display to automatically adjust to the size of the window, providing a more seamless user experience.

How do I install QEMU Guest Tools and SPICE Guest Tools in the guest?

After the installation of the Windows 10 guest, you can install QEMU Guest Tools and SPICE Guest Tools by following the instructions provided by their respective documentation. These tools enhance the guest’s performance and provide additional features.

What are the `virtio` guest tools?

virtio guest tools are a set of drivers and utilities that improve the performance and functionality of virtual machines using the virtio framework. These tools are specific to the virtio virtualization platform and need to be installed in the guest machine.

How can I remove the temporary disk and change the NIC to `virtio`?

To remove the temporary disk and change the NIC to virtio, you can go to the virt-manager interface, select the virtual machine, and navigate to the appropriate settings. From there, you can remove the temporary disk and change the NIC to virtio by selecting the respective options.

Is it possible to revert the changes and go back to the original configuration?

Yes, if you want to revert the changes and go back to the original configuration, you can simply undo the steps you followed in the setup process. This may involve removing the virtual machine, reinstalling Windows 10, or adjusting the settings in virt-manager accordingly.

Leave a Comment

Your email address will not be published. Required fields are marked *