VMware Virtual machine configuration serial port

Source: Internet
Author: User
Tags python script

VMware offers 4 serial port types We can do some research and development and deployment of VMware automation through serial ports.

VMware serial Port Type

1. Use the physical serial port on the host

2. Output to File

3. Connecting to Named Pipes

4, through the network connection

I'm using the 4th way to verify that the serial port needs to be pre-deployed VSPC server and the network is open and the server port is released.

Also, because Windows systems only need to install VMware tools tools, it's not much easier to write. Here are some Linux virtual machine configurations.


First, install the VMware Tools tool for the virtual machine.

Broadly divided into the following steps

    1. Virtual machine hangs Tools Tool Mirror Disk

    2. into the system mount the image to the /media#mount/dev/cdrom/media

    3. Unpacking Kit #tar –zxvf/media/vmwaretools-<version>.tar.gz–c/tmp/

    4. Execute the installation script #cd/tmp/vmware-tools-distrib

#./vmware-install.pl

./ after execution, press ENTER with the default configuration option to install successfully , you will see the Enjoy Word indicating that the installation was successful.

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/76/3D/wKiom1ZNmeSAHDzCAAIq0hRNJBU301.png "title=" Picture 1. PNG "alt=" Wkiom1znmesahdzcaaiq0hrnjbu301.png "/>


Second, the configuration of the serial port

need to know before configuring the serial port The configuration of the serial port is based on Grub Different configurations of the version before configuring the serial port to determine which grub the virtual machine belongs toThe version is then configured again. General Redhat and CentOS7 The Previous version was using grub Version1 Debian and Ubuntu Grub Version2 for Systems the more.

1, The Grub version of the judgment

version 1 in the/boot/grub directory will see the word 1_xxx with the file name .

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/76/3F/wKiom1ZNy0jBmuO2AAEk32mFizg779.png "title=" Grub 1. PNG "alt=" Wkiom1zny0jbmuo2aaek32mfizg779.png "/>

Version 2: Open/boot/grub/grub.cfg file See the configuration in the inside more like some functions such as:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/76/3E/wKioL1ZNy4SxqjoDAALm9ZJfFfk519.png "title=" Grub2.png "alt=" Wkiol1zny4sxqjodaalm9zjfffk519.png "/>

2. serial port configuration

Grub version 1 the configuration

1> vi/boot/grub/grub.conf Add the following two lines below the boot line

Serial---Unit=0–-speed=19200–-word=8–-parity=no–-stop=1

Terminal--timeout=10 Serial Console

2> is appended at the end of the kernel line as follows

CONSOLE=TTYS0 CONSOLE=TTYS0,19200N8

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/76/3E/wKioL1ZNzBijRS6JAAPRn-Cp-DA711.png "title=" Gb1.png "alt=" Wkiol1znzbijrs6jaaprn-cp-da711.png "/>


Grub version 2 the configuration

1> edit /etc/default/grub file append the following configuration

# Vi/etc/default/grub

grub_cmdline_linux= ' Console=tty0 console=ttys0,19200n8 '

Grub_terminal=serial

grub_serial_command= "serial--speed=19200--unit=0--word=8--parity=no--stop=1"


2> Save after exiting update Grub The command is as follows

# Update-grub


3. See if the configuration is successful

Grub after the configuration, check the process in the system . You can see the following words that have been configured to take effect

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/76/3F/wKiom1ZNzHuBYz9XAAERluXOhuQ086.png "title=" ps.png "alt=" Wkiom1znzhubyz9xaaerluxohuq086.png "/>



Third, the virtual machine add serial port

1. the steps required to add a serial port on a virtual machine are as follows

Select Cloud Host right - Edit Settings - Virtual machine Properties - add - Serial port - next - Select "Connect over the network"

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/76/3F/wKiom1ZNzQeSa_PJAAGDT9O1rsQ227.png "title=" Add. png "alt=" Wkiom1znzqesa_pjaagdt9o1rsq227.png "/>


Next Step - Select "Server"

Port URI set to vspc.py

Tick "Use virtual serial port concentrator"

Vspcuri set to telnet://10.13.1.171:13370

Here is the IP address of my VSPC server and the port number of the server.

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/76/3E/wKioL1ZNzguxoC2dAAIro1-qkJs827.png "title=" Vspc.png "alt=" Wkiol1znzguxoc2daairo1-qkjs827.png "/>

Next confirmation Message--complete

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/76/3E/wKioL1ZNzkzycKvNAAGzoq-rXps159.png "title=" confirm. png "alt=" Wkiol1znzkzyckvnaagzoq-rxps159.png "/>

Iv. verifying that the serial port is valid

1. Login to VSPC Server

SSH [email protected]

2. Start VSPC Server

Pythonvspc.py-s

The startup is displayed as follows

Ps-ef |grep SPC

Root 1152 1 0 16:28 00:00:00 python vspc.py-s

Root 1178 1130 0 16:37pxs/0 00:00:00 grep--color=auto SPC

3. Check the new VMS whether the serial port is available

Execution pythonvspc.py 10.13.1.171

The results are shown below

51CTOBLOG-CENTOS6.5-0428:500456DC2A8BE7A5-3F37B07016B9DFFF:50000

Check your new open serial ( and add the serial port configuration of the VM is shown after the above operation, where 51ctoblog-centos6.5-0428 is the name of the virtual machine I just configured .)

If no display instructions VM Add serial port configuration is not correct please check.

If there is a display to perform telnet10.13.1.171 50000( This value is for you to test when taking a new vm The corresponding value after the name

perform telnet 10.13.1.17150000:

Linux is displayed as

Trying 10.13.1.171 ...

Connected to 10.13.1.171.

Escape character is ' ^] '.

Can be displayed after carriage return

CentOS Release 6.5 (Final)

Kernel 2.6.32-431.el6.x86_64 on an x86_64

Localhost.localdomain Login:

Understand the serial port configuration is correct.

If there is no response after carriage return, the system turns on the serial port is not configured correctly.

Windows Display

Trying 10.13.1.171 ...

Connected to 10.13.1.171.

Escape character is ' ^] '.

can be displayed after carriage return

Sac>

Sac>

If there is no response after carriage return, the system turns on the serial port is not configured correctly.


4, the serial port after the successful addition can be directly through the serial port I modify the password IP address configuration, and combined with code scheduling to achieve automated operation and maintenance management.


Finally, a brief introduction to VSPC is a Python script


Vspc.py-a Virtual Serial Port concentrator for VMware


Run ' vspc.py-h ' for full help.


This server was based on publicly available documentation:

Http://www.vmware.com/support/developer/vc-sdk/visdk41pubs/vsp41_usingproxy_virtual_serial_ports.pd

F

http://sourceforge.net/p/vspcpy/home/Home/


Download connection

git clone git://git.code.sf.net/p/vspcpy/code vspc.py


This article is from "Jason's blog" blog, please be sure to keep this source http://xujunxian.blog.51cto.com/8614409/1714841

VMware Virtual machine configuration serial port

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.