Get the App
SLTechnology News&Howtos  ›  Servers  › 

[VNC] modify the resolution size of VNC

Shulou Source: shulou.com Published: 2022-06-02 05:10:26 10月18日 Update

The low resolution of VNC may cause the "confirmation key or cancel key" to fail to click during the operation of the graphical interface, and the high resolution may cause the low-resolution client display to fail to display.

This paper presents two methods to adjust the resolution of VNC for reference.

1. The first method: adjust using the geometry parameter

Use the man command to get a description of the geometry parameter

[root@secdb ~] # man vncserver

……

-geometry widthxheight

Specify the size of the desktop to be created. Default is 1024x768.

……

As you can see, the default resolution is 1024x768, which we can use to adjust the resolution.

For example, we need to adjust the resolution to 800x600

[root@secdb ~] # vncserver-geometry 800x600

New 'secdb:5 (root)' desktop is secdb:5

Starting applications specified in / root/.vnc/xstartup

Log file is / root/.vnc/secdb:5.log

At this point, log in to VNC with "192.168.23.102" and you will get an operation window for 800x600.

Please try other resolution adjustments by yourself.

two。 The second method: modify the configuration file vncservers

[root@secdb ~] # vi / etc/sysconfig/vncservers

# The VNCSERVERS variable is a list of display:user pairs.

#

# Uncomment the line below to start a VNC server on display: 1

# as my 'myusername' (adjust this to your own). You will also

# need to set a VNC password; run 'man vncpasswd' to see how

# to do that.

#

# DO NOT RUN THIS SERVICE if your local area network is

# untrusted! For a secure way of using VNC, see

#.

# VNCSERVERS= "1:myusername"

# VNCSERVERARGS [1] = "- geometry 800x600"

VNCSERVERS= "1:root 2:oracle"

VNCSERVERARGS [1] = "- geometry 1024x768"

VNCSERVERARGS [2] = "- geometry 1024x768"

For example, we can adjust the last line to the following

VNCSERVERARGS [2] = "- geometry 800x600"

After restarting vncserver, log in to VNC using "192.168.23.102 800x600" and you will get an operation window for 800x600. The user is oracle.

[root@secdb ~] # / etc/init.d/vncserver restart

Shutting down VNC server: 1:root 2:oracle [OK]

Starting VNC server: 1:root 2:oracle [OK]

3. Summary

The two revision methods have their own advantages and disadvantages. Please adjust them according to the specific environment. The first method is easy to operate and has a small scope of influence, because this method provides services by starting vnc processes separately, but it is easy to leave too many vnc processes in the system; the second method is achieved by adjusting the default resolution of VNC to achieve centralized management, but there is a problem that the client can not use it because of the high resolution adjustment.

Tags: Resolution adjustment method parameter client client process login line content pros and cons commands graphics summary means simple operation file display environment user Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple vpn Huawei NVidia Docker