Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

[VNC] modify the resolution size of VNC

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report