Different display sizes for GUI apps in LXD container

Update: See below


You could also use Wayland (+XWayland) for at least some of your usecases.
Note: This is usable for both X-Server and Wayland, because Wayland can run on top of an X-Server as well.

This way you can run a seperate wayland server on top of an x-server or wayland-server.
You then have a seperate window in which a small desktop is running (the applications inside the container will then run inside that desktop window).
You can also set the window size:
https://jlk.fjfi.cvut.cz/arch/manpages/man/weston.1.en

--width=W , --height=H
Make the default size of each X window *W* x *H* pixels.

The only remaining question is how many nested wayland servers are possible to run at the same time.
But I guess you could try it out :smile:.

For some of your usecases, like using a webbrowser, you could also try a solution @simos already mentioned, because for those you don’t need acceleration.