Centos6 configure vnc to log on to a remote physical machine and copy vdi to start the Virtual Machine network. centos6vdi

Source: Internet
Author: User

Centos6 configure vnc to log on to a remote physical machine and copy vdi to start the Virtual Machine network. centos6vdi

1. Install vnc and vncserver

# Yum install tigervnc-server

2. Start the VNC service
# Vncserver
You will require a password to access your tops.
Password:
Verify:
You will be prompted to enter the password, which is required for remote logon. I tried to log on without a password. It seems that I still cannot. The entire password is required. Disable the firewall here,/etc/init. d/iptables stop

3. Edit the VNC configuration file
Vi/etc/sysconfig/vncservers
VNCSERVERS = "1: root" // remove #. Configure the desktop number and user name as needed.
VNCSERVERARGS [2] = "-geometry 1024x768-nolisten tcp-localhost" // remove #, configure resolution
Save the modification and exit.

4. Set the vnc server to automatically start upon startup:
Method 1: run the "ntsysv" command to start the graphical service configuration program. Select the vncserver service and click "OK.
Method 2: run the chkconfig command on the terminal:
# Chkconfig vncserver on
# Chkconfig -- list vncserver
Vncserver 0: off 1: off 2: on 3: on 4: on 5: on 6: off

5. Change the VNC connection password: (you can leave it unchanged)
# Vncpasswd

Here, the VNC Server is basically complete. You can remotely log on to CentOS on another machine using a VNC client (such as RealVNC:
Enter CentOS system IP: 5901 (default port number). For example, enter 192.168.1.100: 5901 in the RealVNC window)
You will be prompted to enter the password.

6. If there is a gray screen after the connection or only the terminal (command line) does not enter the graphic interface (if the graphic interface is installed), you can set it as follows:

Enter the user's home directory, cd/home/user
If you log on with the root account, the current directory is the root directory of the user.
# Cd ~ /. Vnc
Vi xstartup // edit the xstartup Configuration
# Twm & // Add #, comment out this line
Gnome-session & // Add this line
Save and exit to connect normally!

Vbox installation: http://www.cnblogs.com/xia520pi/p/3545666.html

RHEL6.3 is installed in the testing environment of the company. After cloning the virtual machine, the cloned Virtual Machine Nic cannot start. The following error is reported:
[Root @ localhost Desktop] # service network restart
Shutting down loopback interface: [OK]
Bringing up loopback interface: [OK]
Bringing up interface eth0: Error: No suitable device found: no device found for connection 'System eth0 '.
[FAILED]

When you execute the ifconfig command, you will find that the configuration file of the eth1 Nic is/etc/sysconfig/network-scripts/ifcfg-eth0.

[Root @ localhost network-scripts] # ifconfig | grep addr
Eth1 Link encap: Ethernet HWaddr 00: 0c: 29: f4: 95: e3
Inet6 addr: fe80: 20c: 29ff: fe5c: 65b7/64 Scope: Link
Interrupt: 19 Base address: 0x2024
Inet addr: 127.0.0.1 Mask: 255.0.0.0
Inet6 addr: 1/128 Scope: Host
[Root @ localhost network-scripts] # ls
Ifcfg-eth0 ifdown-isdn ifup-aliases ifup-plusb init. ipv6-global
Ifcfg-lo ifdown-post ifup-bnep ifup-post net. hotplug
Ifdown-ppp ifup-eth ifup-ppp network-functions
Ifdown-bnep ifdown-routes ifup-ippp ifup-to-date-routes network-functions-ipv6
Ifdown-eth ifdown-sit ifup-ipv6 ifup-sit
Ifdown-ippp ifdown-tunnel ifup-isdn ifup-tunnel
Ifdown-ipv6 ifup-plip ifup-wireless
[Root @ localhost network-scripts] #

This problem occurs because the MAC address of the virtual network card allocated to the operating system by the virtual machine is different. The MAC address of the network adapter of the first system is recorded in/etc/udev/rules. d/70-persistent-net.rules and named eth0. The MAC address of the NIC of the newly cloned system is also recorded in this file, which is the same as that of the previous system, so there is a conflict.

You can check the content of the 70-persistent-net.rules file of the two hosts.

First system:
[Root @ localhost rules. d] # cat 70-persistent-net.rules
# This file was automatically generated by the/lib/udev/write_net_rules
# Program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# Line, and change only the value of the NAME = key.

# PCI device 0x1022: 0x2000 (pcnet32)
SUBSYSTEM = "net", ACTION = "add", DRIVERS = "? * ", ATTR {address} =" 00: 0c: 29: f4: 95: e3 ", ATTR {type} =" 1 ", KERNEL = "eth *", NAME = "eth0"
 

Cloned system:

[Root @ localhost rules. d] # cat 70-persistent-net.rules
# This file was automatically generated by the/lib/udev/write_net_rules
# Program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# Line, and change only the value of the NAME = key.

# PCI device 0x1022: 0x2000 (pcnet32)
SUBSYSTEM = "net", ACTION = "add", DRIVERS = "? * ", ATTR {address} =" 00: 0c: 29: f4: 95: e3 ", ATTR {type} =" 1 ", KERNEL = "eth *", NAME = "eth1"
 

We can see that the MAC addresses in these two systems are the same.

Solution:
Delete/etc/udev/rules in the cloned system. d/70-persistent-net.rules file. After restart, the system will generate a new MAC address for the virtual network card, and change eth1 of NAME = "eth1" in this file to eth0, you also need to modify the mac address in ATTR {address} and the mac address of the/etc/sysconfig/network-scripts/ifcfg-eth0 file, and keep it consistent with the MAC address of the new virtual Nic.

For example
SUBSYSTEM = "net", ACTION = "add", DRIVERS = "? * ", ATTR {address} =" 00: 0c: 29: f4: 95: e3 ", ATTR {type} =" 1 ", KERNEL = "eth *", NAME = "eth1"
 

Change to SUBSYSTEM = "net", ACTION = "add", DRIVERS = "? * ", ATTR {address} =" 00: 0c: 29: 5c: 65: b7 ", ATTR {type} =" 1 ", KERNEL = "eth *", NAME = "eth0"
 

Modify the/etc/sysconfig/network-scripts/ifcfg-eth0 File

DEVICE = "eth0"
IPV6INIT = "yes"
NM_CONTROLLED = "yes"
ONBOOT = "yes"
TYPE = "Ethernet"
UUID = "05944003-ae77-4c9d-9e58-3ec2851db71d"
DEFROUTE = yes
20174_failure_fatal = yes
IPV6_AUTOCONF = yes
Required 6_defroute = yes
20176_failure_fatal = no
NAME = "System eth0"
HWADDR = 00: 0c: 29: 5c: 65: b7
Then restart the network service and find that everything is normal.
[Root @ localhost Desktop] # service network restart
Shutting down interface eth0: Device state: 3 (disconnected)
[OK]
Shutting down loopback interface: [OK]
Bringing up loopback interface: [OK]
Bringing up interface eth0: Active connection state: activating
Active connection path:/org/freedesktop/NetworkManager/ActiveConnection/1
State: activated
Connection activated [OK]

After setting the IP address, check again
[Root @ localhost Desktop] # ifconfig | grep addr
Eth0 Link encap: Ethernet HWaddr 00: 0C: 29: 5C: 65: B7
Inet addr: 192.168.0.129 Bcast: 192.168.0.255 Mask: 255.255.255.0
Inet6 addr: fe80: 20c: 29ff: fe5c: 65b7/64 Scope: Link
Interrupt: 19 Base address: 0x2024
Inet addr: 127.0.0.1 Mask: 255.0.0.0
Inet6 addr: 1/128 Scope: Host

Note: If you find that eth1 is still displayed instead of eth0 when executing the ifconfig command, you can restart the system and change it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.