VM

May 192018
 

For connect to virtual machine screen via VNC you need:

  1. Retrieve VM domain number (execute in XenServer console):
    xe vm-list params=dom-id name-label=[vm name] | grep dom-id
  2. Retrieve VNC port for this domain (execute in XenServer console):
    xenstore-read /local/domain/[domain]/console/vnc-port
  3. Make remote connection ([port] – last two digits from previous output), execute in remote console:
    vncviewer -via root@[xenserver] localhost:[port]

All together from remote console xen_vm_screen.sh:

#!/bin/bash
XEN_HOST=$1
VM=$2
XEN_USER=root
DOMAIN=`ssh $XEN_USER@$XEN_HOST "xe vm-list params=dom-id name-label=$VM | awk -F ':' '{gsub(/[ \t]+/, \"\", \\\$2); print \\\$2}'"`
VM_PORT=`ssh $XEN_USER@$XEN_HOST "xenstore-read /local/domain/$DOMAIN/console/vnc-port"`
vncviewer -via $XEN_USER@$XEN_HOST localhost:${VM_PORT:2:2}

Execute it as:

bash ./xen_vm_screen.sh vm_host_name vm_name
Apr 282013
 

Objective: Move the Windows virtual machine, you can change when you transfer the resources allocated system
Problems: Converting using XenConvert whole system in OVF format can be imported only through the XenCenter and does not always work
Warning: this work only on EXT storage (not LVM)

  1. Install XenConvert on Windows
  2. Export appropriate volumes using XenConvert in the format VHD (it is recommended to export only drive C, just copy the other disks)
  3. Copy the VHD file to a location accessible from the XenServer
  4. Download and install the vhd2xen.i686 utility on XenServer
  5. Import VHD disk in XenServer:
    /usr/lib/Acronis/VHD2XEN/vhd2xen.sh [VHD file]
  6. Create a virtual machine In XenCenter from a template corresponding to the exported system
  7. Remove all the created discs In the newly created virtual machine and attach imported disk
  8. Start the virtual machine and fix the settings in Windows, if necessary
Sep 232012
 

I need to create virtual machine on XenServer (6.2.0) but I have access to console/SSH only

Solution:

  1. Virtual machine based on template. For select template execute:
    xe template-list
  2. After selecting template, create VM:
    xe vm-install template="Debian Wheezy 7.0 (32-bit)" new-name-label="newVM"

    so VM based on Debian Wheezy 7.0 (32-bit) template, VM name is newVM
    Last command execution produced UUID for created VM

  3. Continue reading »