4

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.

2

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

| improve this answer | |
2

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.

| improve this answer | |
  • Ok, that sounds good. But, if at all possible, I want to do this with the built-in vnc server. – Nathan G. Jul 10 '11 at 15:38
  • @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. – Nathan G. Jul 10 '11 at 21:04
  • @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). – Takkat Jul 10 '11 at 21:43
  • 1
    Tested with a mac, works fine. If you have it running on :1, simply use vnc://servername:5901 to connect. – Jack M. Jul 12 '11 at 20:43
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

| improve this answer | |
  • Awesome Man. Thanks for the command. It worked for me. – S Andrew Apr 18 '19 at 10:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.