Headless machine: Increase Remote Desktop resolution

17,090

Solution 1

By using the default Gnome vino-server we are stuck to the running X-Server geometry. If for any reasons we do need to run the vino-server we can only change the display geometry by defining a custom X-Session for this VNC usage or change the geometry live e.g. with randr as described in principle in this answer.

However doing so has some disadvantages that need to be considered:

  • if predifined We are unable to run this custom session when another monitor is connected.
  • Other X devices may need to be defined as well.
  • changing the geometry for a VNC session remotely cannot easily be done.
  • if we break our X settings we may end up with no display

If we do need adjustments in screen geometry it would therefore be a better advice to install a VNC-server package other than vino that is capable of changing the geometry.


If we use vncserver/Xvnc from either tightvncserver Install tightvncserver, or vnc4server Install vnc4server we may define a virtual XServer geometry by simply adding the option -geometry <width>x<height> when invoking.

After having installed one of the packages above on the remote we start it there by e.g.

vncserver :1 -geometry 1024x720

In this example a display with number 1 is created having 1024x720 pixels (after entering a password for the connection). This can be accessed from the local machine by

vncviewer <remote_ip>:1

Use option -via when connecting with a SSH session.

Solution 2

I don't no if this can be an easy solution in Ubuntu too, but i had the same problem with Linux Mint 18.2(ubuntu derivative) and using VNC-viewers on linux, windows and android

After some testing i cam e up with the following solution (at least working for my situation):

I made a script file (for example called 'SetResolution1280x1024.sh' ), containing these lines:


$ #!/bin/bash

$ xrandr --fb 1280x1050


and saved it in one of the user folders. Then made it executable (rightclick>properties>permissions and check the box 'allow executing file as program')

Then i made it execute at startup:

Menu -> System Settings -> Startup & Shutdown -> Autostart

Click: 'Add Script'

searched for the folder where i put the scriptfile, and clicked 'OK'

Then i selected the option to start it 'Pre KDE'

(executing it just 'at startup' did not work properly, so i guess the resolution has to be set before the desktop starts, otherwise you end up with a small desktop on a large screen. This last thing also happend when executing the script from the active desktop !)

This worked for me, without disrupting my system (wich i did trying the 'dummy driver':)

May this will help some others

Jeroen

Solution 3

Have you considered to try an NX technology?, like FreeNX or NXnoMachine ?, it can be more friendly and configurable

Share:
17,090

Related videos on Youtube

Nathan G.
Author by

Nathan G.

Language, learning, and light. Water, walking, and wonder. Books, biking, and beverages. Endlessly excited by the world. Dartmouth ’19. Magically real.

Updated on September 18, 2022

Comments

  • Nathan G.
    Nathan G. over 1 year

    I have a headless Ubuntu machine that I connect to with a combination of ssh and vnc.

    When I've got a monitor attached (which is rare), the vnc connection is the full resolution of the attached monitor (of course).
    But, when I connect using vnc when there's no monitor connected, I get a much lower-resolution connection than I would like. It's as if the computer has a tiny monitor connected.

    I have looked through Settings and haven't found anything promising (resolution was grayed out without a monitor connected).

    How can I change the 'virtual resolution' that I get when I connect using VNC?

    Update:

    I'm not interested in recommendations for other vnc software now, I just want to know how to do the above with the built-in vnc server.
    Thanks.

  • Nathan G.
    Nathan G. almost 13 years
    Ok, that sounds good. But, if at all possible, I want to do this with the built-in vnc server.
  • Nathan G.
    Nathan G. almost 13 years
    @Takat Re: your update, I need to use vino because the computer that connects to it is a Mac, so I can't install the software you mention above. If you can set up vino to use a higher resolution, please do tell me how. Thanks.
  • Takkat
    Takkat almost 13 years
    @Nathan G.: I can't test this - no Mac here - but vncserver uses the same protocol as does vino. From Ubuntu you also use the same client (vncviewer). There should be no reason for a MAC to not display the desktop that comes from xvnc/vncserver. Before you take the pain of diving into XServer configuration I'd at least give it a try. For tightvncserver it's 1,901 kB disk space and you will be able to purge it w/o further dependencies (vnc4server is ~5 MB).
  • Jack M.
    Jack M. almost 13 years
    Tested with a mac, works fine. If you have it running on :1, simply use vnc://servername:5901 to connect.
  • S Andrew
    S Andrew about 5 years
    Awesome Man. Thanks for the command. It worked for me.