[SOLVED] What controls VM console resolution? (noVNC) (Ubuntu)(cloud-init)

AlexHK

Active Member
Apr 9, 2020
21
3
43
Good ol' Austria
Sorry if this looks mundane, but I have tried finding this piece of info for a few days without success.

What determines the console resolution (noVNC) used on a VM if I enter the console on the Proxmox UI?


Until recently I mostly installed my VMs from scratch using installer ISOs. Recently I started to play around with cloud-init, now I noticed that my cloud-init with cloud image installed VMs (ie. Ubuntu) have a very low resolution in their console window when I use the Proxmox UI.

I compared an old VM and the new cloud-init/cloud image VM.
  • Both have identical hardware (BIOS, Display, Machine type)
  • Both have no specific vga: setting in the VM .conf file
  • One installed from the installer ISO ("good" resolution)
  • The other installed from the cloud image

1749550769336.png

This is how it usually looks:

1749550846573.png


This is how it now looks with the cloud-images:

1749550890064.png

Thanks in advance.
 
Last edited:
Hi!

How did you setup the cloud init VM? Usually, cloud init VMs are expected to be used over a serial interface instead of a graphical display. Usually this is done by setting kernel parameters, e.g. providing the console parameter to the kernel. You can see the current kernel parameters in /proc/cmdline.
 
I'm guessing it has to do with different defaults and/or missing drivers for the cloud kernel because this also happens if you install linux-image-cloud-amd64 on a normal debian installation. You can change this with the vga kernel arg. Try vga=791 for example. For details see here and here and here.

Before
Code:
# cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-6.1.0-37-amd64 root=UUID=781a9a4c-77cb-4ac6-9e0b-854b6e51e597 ro delayacct console=ttyS0 console=tty0
Code:
# lspci -s 00:02 -k
00:02.0 VGA compatible controller: Device 1234:1111 (rev 02)
        Subsystem: Red Hat, Inc. Device 1100
        Kernel driver in use: bochs-drm
        Kernel modules: bochs
base.png
After installing cloud kernel
Code:
# cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-6.1.0-37-cloud-amd64 root=UUID=781a9a4c-77cb-4ac6-9e0b-854b6e51e597 ro delayacct console=ttyS0 console=tty0
Code:
# lspci -s 00:02 -k
00:02.0 VGA compatible controller: Device 1234:1111 (rev 02)
        Subsystem: Red Hat, Inc. Device 1100
See how there's no VGA driver in use for the cloud kernel because the bochs.ko module does not exist in the kernel's /lib/modules/ path?
after.png

After adding vga=791
Code:
# cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-6.1.0-37-cloud-amd64 root=UUID=781a9a4c-77cb-4ac6-9e0b-854b6e51e597 ro delayacct console=ttyS0 console=tty0 vga=791
Code:
# lspci -s 00:02 -k
00:02.0 VGA compatible controller: Device 1234:1111 (rev 02)
        Subsystem: Red Hat, Inc. Device 1100
afterfix.png
 
Last edited:
  • Like
Reactions: AlexHK
Thank you @dakralex and @Impact for your effort to answer my question, very helpful indeed!

Hi!

How did you setup the cloud init VM? Usually, cloud init VMs are expected to be used over a serial interface instead of a graphical display. Usually this is done by setting kernel parameters, e.g. providing the console parameter to the kernel. You can see the current kernel parameters in /proc/cmdline.

I setup the cloud-init VM using serial, later removed it using qm set 9000 --delete vga --delete serial0 before making the VM a template.

I'm guessing it has to do with different defaults and/or missing drivers for the cloud kernel because this also happens if you install linux-image-cloud-amd64 on a normal debian installation. You can change this with the vga kernel arg. Try vga=791 for example. For details see here and here and here.

You are absolutely right, thanks a lot.

I added the following to my #cloud-config snippet and now all is good:

Code:
#cloud-config
[...]
runcmd:
- systemctl enable qemu-guest-agent
- systemctl start qemu-guest-agent
# Add GRUB configuration for framebuffer
- sed -i 's/GRUB_CMDLINE_LINUX=""/GRUB_CMDLINE_LINUX="vga=871"/' /etc/default/grub
- update-grub