In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains how to configure vnc in centos 5.5. Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's take you to learn how to configure vnc in centos 5.5.
1. Check whether vnc is installed on this machine (centOS5 has vnc installed by default)
rpm -q vnc vnc-server
If the result is:
package vnc is not installed
vnc-server-4.1.2-14.e15_3.1
Congratulations, VNC is already installed on your machine. If it is not installed, use the command:
#yum install vnc-server(note install under root)
#yum install vnc
#yum groupinstall "GNOME Desktop Environment"
2. Add the remote desktop user to the profile (ROOT user as an example below)
vi /etc/sysconfig/vncservers
Open the configuration file using vi editor and add the following two lines to the file
VNCSERVERS="1:root 2:leo"
VNCSERVERARGS[1]="-geometry 800x600"
VNCSERVERARGS[2]="-geometry 1024x768"
Description:
First, the "username" here refers to the name of the linux system user.
Second, the first of the three lines above is to set the account that can use VNC server. You can set multiple accounts, but the middle should be separated by spaces. Note the number "1" or "2" in front. When you want to access VNC servers from other computers, you need to use IP:1 instead of IP directly. If you assume that your VNC server IP is 192.168.1.100, then you want to enter the VNC server and log in as peter user, you need to enter the IP in the vncviewer: 192.168.1.100:1, if it is root, it is 192.168.1.100:2.
Third, the bottom two lines [1][2] should preferably correspond to the one above, and the 800x600 at the back can be replaced by the resolution supported by your computer. Note that the middle "x" is not an "*", but a lowercase letter "x".
3. Set passwords for configured remote desktop users
vncpasswd
Note: This is to configure the password for the root remote user above, so configure it under the root account; and so on, for other accounts with passwords, you must configure commands under other accounts.
4. Modify Remote Desktop Display Profile
cd ~/.vnc/ (/root/.vnc)
vi xstartup
The original xstartup file should read as follows:
#!/ bin/sh
# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
Just remove the #symbol in the third line above and before the fourth line. Of course, if you want to enter the VNC server and see the graphical interface, you need to comment out the last line and add gnome-session $.
The revised document should read as follows:
#!/ bin/sh
# Add the following line to ensure you always have an xterm available.
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
gnome-session &
Description:
First, do not modify this file The remote desktop you see is very simple, equivalent to command line operation, in order to operate remotely as local operation, be sure to refer to the following ways to modify
Second, as long as you enable VNCserver once, it can be automatically created as follows:
#/sbin/service vncserver start
#/sbin/service vncserver stop(start and then close, convenient for the following operations)
Using the above method, you can create an xstartup file in the.vnc directory of the user's home directory.
5. Related vnc service operation instructions
#/sbin/service vncserver start
#/sbin/service vncserver stop(start and then close, convenient for the following operations)
#/sbin/service vncserver restart
6.iptables Firewall will often block vnc remote desktop, so you need to allow iptables, with the following command
When you start the vnc service, you can use the netstat-tunlp command to check the ports used by the vnc service. You can find 5801, 5901, 6001, etc. Open these ports using the following command:
vi /etc/sysconfig/iptables
Add:
-A RH-Firewall-l-INPUT -p tcp -m tcp --dport 5900:5903 -j ACCEPT
service iptables save
service iptables restart //restart firewall
Or worse! Close the firewall!
service iptables stop
7, Boot automatically start vnc
vi /etc/rc.d/rc.local
Open the configuration file using vi editor and make the following modifications
/etc/init.d/vncserver start --Add new line
8. Possible problems:
a, black screen
After installing and configuring the VNC server in Linux, it is found that there will be a black screen when multiple users log in. The specific phenomenon is as follows:
The client can log into the system through IP and session number, but it is dark when logging in, except for a forked mouse.
Cause: The user's VNC boot file permissions are not set correctly.
Workaround: Change the attributes of the xstartup (usually: /home/username/.vnc/xstartup) file of the black screen user to 755 (rwxr-xr-x).
Kill all VNC clients that are already started:
vncserver -kill :1
vncserver -kill :2 (Note: -kill has a space between:1 or:2)
Finally restart vncserver service! service vncserver restart
b. How to log in to VNC Server under Windown
(1). Log in from IE
Enter the following address directly from IE:
http://xxx.xxx.xxx.xxx:5802
(2). Log in from VNC view
Install vnc view on windows and type xxx.xxx:x to connect to login.
Remarks:
A, input format for IP: number, number depends on your own configuration!! 192.168.1.111: 1
B, login prompt connection refused(10061), it is because of the Linux firewall problem, please check the firewall settings. c. The suffix ":x" after it cannot be less, otherwise the old prompt failed to connect : connection refused (10061) )
At this point, I believe everyone has a deeper understanding of "how to configure vnc in centos 5.5," so let's actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!
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: 298
*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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.