Can containers or vms support better resolution than 800x600?

Hello all,

Thank you in advance for any suggestion/advise.

My question is very simple, I have LXD 4.21 server running in an old dell laptop Latitude E6540, no special Nvidia card or a fancy GPU, nothing of that. I created an LXC vm and installed the xubuntu minimal graphical environment that gave me the essential user interfaces to run internet browsers, and some other tools, the LXC vm runs XFCE and I connect to it via nomachine applicationalso known as (NX), similar to x2go, however, the best resolution I am able to get on the LXC vm is 800Ă—600 I wonder if the limitation is the dell laptop, the kernel I am running on the laptop or if this is a limitation on LXD/LXC? any suggestions will be greatly appreciated.

Sincerely,

A few details about the LXD host:

OS: Ubuntu 20.04.3 LTS x86_64
Host: Latitude E6540 01
Kernel: 5.11.0-43-generic
Resolution: 1920x1080
CPU: Intel i7-4600M (4) @ 3.600GHz
GPU: Intel 4th Gen Core Processor
Memory: 9141MiB / 15911MiB

Sincerely,

LXD itself doesn’t impose any such restriction on our VMs and the virtio-gpu driver in most guest OS can run very high resolutions (though pretty slowly as there’s no hardware acceleration).

Merci @stgraber,

Is this driver used by default or do I need to indicate it with some option on LXD? I mean do I need to tell the container VM to use the virtio-gpu driver?

I tried:
$ sudo lxc info vm1
and
$ lxc config show vm1

But none of them show what kind of driver is the VM using… little help, please?

Thank you in advance,

Are you dealing with a container or a VM?

LXD containers don’t have graphics cards, LXD VMs have a graphics card that’s using the virtio-gpu device model from QEMU. What driver is used is then up to the guest OS and not something LXD has any control over.

Both Windows and modern Linux at least have virtio-gpu drivers that can run resolutions well in excess of 1920x1080.

1 Like

Hello @stgraber,

Correct, I am using an LXD VM:

$ lxc info vm1
Name: vm1
Status: RUNNING
Type: virtual-machine
Architecture: x86_64
PID: 2091396
Created: 2021/12/19 00:47 JST
Last Used: 2021/12/28 04:02 JST

I now need to figure out how to verify what virtual driver is this Ubuntu 20.04 VM is currently using.

Actually, I ran lspci in the LXD VM and was able to verify:
04:00.0 VGA compatible controller: Red Hat, Inc. Virtio GPU (rev 01)
This is the virtual driver, however, when I check the settings on the LXD VM XFCE display settings I see this:

And that is the only option I have.

Thank you,

@stgraber,

I also noticed that the LXD VM is running this kernel: Welcome to Ubuntu 20.04.3 LTS (GNU/Linux 5.4.0-91-generic x86_64)

Which got me thinking, why isn’t using the latest one? or at least the same kernel of the host LXD: Linux lxc1 5.11.0-43-generic #47~20.04.2-Ubuntu SMP Mon Dec 13 11:06:56 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

I will go ahead and install the latest kernel in the LXD VM and see what are the results.

Sincerely,

Hello @stgraber,

That did the trick, I installed the kernel: Welcome to Ubuntu 20.04.3 LTS (GNU/Linux 5.11.0-43-generic x86_64) and now I can set larger amounts of resolutions, very nice!

Two last questions I am sure they might be already asked and answered, I will be searching for it in the forum, if I need to increase the disk capacity if the LXD VM I guess I can use the command: $ lxc config device override vm1 root size=15GB then use the resize2fs tool to grow the unallocated space?

What about the memory on the LXD VM?

hmm: $ sudo lxc config set vm1 limits.memory=2048 Error: Failed updating memory limit: Failed setting memory to 0MiB (currently 459MiB) as it was taking too long

Alright, I did this: $ lxc config set vm1 limits.memory=2048 now the VM does not boot…

Log:
qemu-system-x86_64: property 'size' of memory-backend-memfd doesn't take value '0'

I did this $ lxc config set vm1 limits.memory 2048MB and we are good now :+1:

Thank you very much!

Excellent :slight_smile:

And yeah, a number amount without units is treated as a number of bytes, so 2048 bytes isn’t going to get you super far with a VM :wink:

1 Like

@stgraber,

Noted that, merci!