How to Fix The Kali Linux Resize Issues in QEMU/KVM

Free Coaching
Our Discord
Free Pentest
Feedback

Welcome to Logos Red, I go bylogos and:

If you’ve recently installed Kali Linux with QEMU, you will notice that the window does not automatically resize itself.

It took me a lot of troubleshooting before I realized that:

This is an issue with XFCE not virt-manager.

I will have two methods, I personally recommend the second method by using KDE. The first method has resulted in some crashes.

My Promise

This post will finally end your meaningless search for a valid answer, and you will leave with your Kali Linux machine resizing right.

If there are still any questions left, let me know so I can add it to help the next person who will arrive here.

My Goal

To help you improve in less time than it took me and to make sure you leave with what I promised.

I want you to join our community and for this to be a place you come back to often.

Method 1 : Creating a udev rule

This method is taken from Dannyda , this being the exact post, I just wanted more people to know about this as I could barely find it, all credits go to him.

I’ve checked the script, it is safe to use. But it has given me crashes under XFCE, which is why I recommend installing KDE with method 2.

Step 1 : Create the Udev Rule File

I personally use vim but you can replace vim with nano.

And add the following line inside of the file:

ACTION=="change",KERNEL=="card0", SUBSYSTEM=="drm", RUN+="/usr/local/bin/x-resize"

Step 2: Create the Bash Script for the Udev Rule

sudo vim /usr/local/bin/x-resize

And add the following code snippet

Step 3: Make it Executable

sudo chmod +x /usr/local/bin/x-resize

That is our first method done, you can now resize the window and everything should work as intended.

Method 2: Installing a Different Desktop Environment

If you were going to switch desktop environments anyway both GNOME and KDE resize as expected with QEMU. I recommend KDE.

Although you need to use virtio with KDE instead of QXL.

GNOME does not seem to work as intended with Kali so GDM crashes often. But it might for you.

These are the commands to install either on Kali Linux.

For KDE:

At the 2nd command make sure to select plasma.

Reboot and in the bottom left make sure to choose “Plasma (X11),” Wayland does not work.

For GNOME:

sudo apt install kali-desktop-gnome

Reboot and then in the bottom right choose your new desktop environment

More Resources

If you didn’t understand something or you need some help, we have our own Discord community and I currently offer free coaching.

You can also leave us some feedback with what you did not understand and we will make sure to correct it.

Free Coaching
Our Discord
Feedback
Scroll to Top