Serial Port Xenserver


XCP has various options for accessing VM consoles. This document describes some of the ways to access those consoles.

Xen has (at least) two distinct ways to access VM consoles. One - using the xc (XenConsole) device (in paravirtualized environment) and second - using a framebuffer (for PV) and/or VGA adapter (for HVM) serializing via VNC. Main idea behind XCP (the open source version of XenServer) is uniform access to all VM regardless their type, so to accomplish this an enterprise management API (xapi) uses vncterm to emulate VNC connection to console for text consoles. Unfortunately, due strict to security, VNCterm only listens on localhost of XCP host. When management tools such as XenCenter or OpenXenManager display the console, they using a special service that requires XenAPI session token and normal authorization. In this case VNC traffic is wrapped in HTTP and is difficult to access manually.

There is (at least) three ways to gain access to VM consoles: using HTTP connection with suitable software, creating custom tunnels with vncterm connections from the XCP host to your own host, and direct access to the console (for PV only).

Multiple Serial Ports / Direct Boot/ pvSCSI など. This patch allows an HVM domain to be created with multiple serial ports. Allow the 'serial' key to accept a list of serial ports, and pass them in using the new seriallist domain build element. Currently in xl.cfg, use 'root' and 'extra' to generate the command line. To be passed directly. Serial tunneling between two serial devices: Serial tunneling enables users to establish a link across Ethernet to a serial port on another terminal server. Back to back: This application is designed to solve a wiring problem. For example, a user needs to replace RS-232, RS-422 or RS-485 wire and run their data over Ethernet without making any.

Access via management software

You can use management tools such as XenCenter, OpenXenManager, or Xen VNC Proxy (XVP) to access consoles. XenCenter is currently only available for Windows platforms. OpenXenManager (and its web counterpart XenWebManager) are under active development. Some limitations may include needing direct access to the system and needed to open ports on the server, making PNAT and DMZ scenarios more challenging. Another issue is that you need to configure server pools according to your needs. For example, by default the console is only available only for the pool master, so if you are running XCP on single computer, this computer will be the master, and if you using two or more hosts in single pool, by default, the first server in pool will be the master.

  • XenCenter (www.citrix.com/xenserver) is available free from Citrix and as of version XCP 1.0 and XenCenter 5.6 FP1 is able manage XCP as well as Citrix XenServer.
  • OpenXenManager is available for download: http://www.openxenmanager.com/
  • XVP is available from http://www.xvpsource.org/
  • See also: XCP Projects

Re: Serial port access from DomU Background:- I have tested a Gentoo Virtual machine (DOMU) to access the serial port of Physical machine (opensuse 11.1) (DOM0) using the following configuration. Step1: Following modules should be loaded on the DOM0 8250 8250pnp serialcore check is using 'lsmod' command.

Custom SSH tunneling

Note: this is not an official way to access consoles, but it is a relatively safe work around. It is extremely useful when requiring console access and you are not using XenCenter and have yet been able to set up something like XVP.

The main problem is that the VNC server for the console listens only on localhost on the host. So you cannot say something like 'vncviewer myxcphost:5901'. It will not work.

You must create a ssh tunnel to the XCP host and setup TCP forwarding from your localhost ports to the localhost ports on the remote SSH server (XCP host in this case). It seems that the default settings for the SSH server (at least on XCP 6.1) do not allow TCP forwarding, so this needs to be enabled before being able to get the TCP ports to forward properly to connect to the console.

Change /etc/ssh/sshd_config to include:

Then restart SSHd. If you are connected via SSH, this will obviously cut you off.

You can now remotely connect to the XCP host and setup SSH port linking to access both the text and graphical consoles. The ports used for VNC console are 5901-5999, and the ports used for text console are 9501-9599. It will look like this:


After that you can gain direct access to the VM consoles by using a vncviewer clinet (for example, xnvcviewer localhost:59XX). To determine what to fill in for XX, see below. Note: the command above creates mapping between the 'localhost' port on the host and the 'localhost' port on your machine. You can use any VNC client, but be aware that some may not work well (for example, users have reported problems with tkvnc on Linux) and users have reported that xvncviewer works well.

Serial Port Xenserver Free

You can also connect to the text console (VT100) on localhost:9501...9599.

Now we need find 'XX' value for host. This is pretty tricky, as the port changes every time the VM migrates, shuts down, etc.

On the XCP host do command:

You can use name-label or uuid or any other attributes to distinguish one VM from other.

Examples:

You will get output like this:

(note: value '-1' means no console avaible, usually meaning that VM is not running, use xe vm-list (without params) to see current status).

Now we have the dom-id. Let's look to xenstore:

(no slash at end)

Buy Serial Port

Serial

Example:

You will get reply like this:



The 'vnc-port =' line is our port.

Now (from you local machine, since that is where the SSH tunnel was created, from above) run `xvncviwer localhost:5911.`

(note, every reboot you will need to reconnect and reestablish the SSH tunnel(s)).

Hacking a vncterm

Note: this is very risky, you will expose unprotected console to 'wild world' and any 'hacker kids' will able to send you 'Alt-SysRq b' keys (regardless of vm login prompt) to reboot your VM.

Theory: vnterm listen on 127.0.0.1 and this is defined in helers code. You can change it to any address you like. File is /opt/xensource/libexec/vncterm-wrapper, variable is export VNCTERM_LISTEN='-v 127.0.0.1:1'.

After that you shall allow connection in firewall to tcp ports 5901..5999 and restart host. After reboot consoles of your VM will be exposed to wild cruel world where anyone can be able to connect to you VM consoles without password.

Serial Port Xenserver

Direct access to text consoles of PV domains

There is undocumented key in vmops.ml source code:

So it simple:

xe vm-param-set uuid=UUID other-config:disable_pv_vnc=true

before starting PV virtual machine, and you will be able to access console via xl console DOMID.

Serial port xenserver meaning

Other way is accessing console of currently running machine without prior reboot. This way may change in the future, so please check for updates on the xen-api mailing list. Also be careful as this methods disrupts normal XCP console access from management tools. So, beware and USE CAUTION (I repeat: you will not be able to connect to this consoles with OpenXenManager or XenCenter).

Also note this method is only available for PV guests with text consoles. It will not work for HVM and PV with framebuffer.

The basic idea is that VNCterm takes the text console and draws them in graphics. So, if we terminate the VNCterm associated with the guest console, we will be able to access text console (instead of VNCterm). Using QEMU to access guest terminals is also being discussed among the xapi developers.

Here simple script, doing all you need:


simply run it with uuid of machine you like to see and you will get access to console OR get message about which host it resides.

Note that the VNCterm sessions are setup by Xapi, which calls the vncterm-wrapper which then runs vncterm.

Serial Port 25 Pin

  • http://community.citrix.com/display/ocb/2011/02/18/Using+VNC+to+Connect+to+a+XenServer+VM's+Console
Retrieved from 'https://wiki.xenproject.org/index.php?title=Xen_Cloud_Platform:_Access_to_VM_console&oldid=17343'

ActiveXperts solution to monitor Citrix XenServer Virtual Infrastructure

Serial Port Xenserver

ActiveXperts Network Monitor continuously monitors Citrix XenServer servers and/or associated virtual machines.

ActiveXperts provides centralized control and visibility into various levels of the XenServer virtual infrastructure, with real-time monitoring of dynamic XenServer virtual elements.
ActiveXperts has deep awareness of all virtual elements and related physical components, including server hardware, shared storage and networking, with event and alarm triggers that make it easier to monitor the environment, diagnose and troubleshoot issues.

ActiveXperts monitors the following XenServer items:

  • CPU Usage (%)
  • Memory Usage (%)
  • Memory Available (MB)
  • Memory Used (MB)
  • Network Packets Received (#)
  • Network Packets Transmitted (#)
  • Network Receiving Rate (Kbps)
  • Disk Usage (%)
  • Disk Space Available (MB)
  • Disk Space Used (MB)
  • Virtual Machine Powered On (y/n)
  • Virtual Machine Running (y/n)
  • Virtual Machine Guest Tools Installed (y/n)
Meaning

The Citrix XenServer check requires the following parameters:

Xenserver Serial Port Passthrough

  • XenServer Host - The IP address or hostname of the Citrix XenServer server that you want to check;
  • Username and Password - The Username and Password used to logon to the XenServer server. These credentials need to be defined once for each XenServer host and can be used for other checks defined for this XenServer server;
  • Monitor XenServer Host or Monitor Virtual Machine - Select either the entire XenServer host (running the Virtual Machines) or an individual Virtual Machine;
  • Check Counter - Select what to monitor: CPU Usage (%), Memory Usage (%), Memory Available (MB), Memory Used (MB), Network Packets Received (#), Network Packets Transmitted (#), Network Receiving Rate (Kbps), Disk Usage (%), Disk Space Available (MB), Disk Space Used (MB), Virtual Machine Powered On (y/n), Virtual MachineRunning (y/n), Virtual Machine Guest Tools Installed (y/n);
  • Value - Minimum/Maximum value for the above Check Counter.