Saturday, October 05, 2013

Neutron basic RDO setup (havana 2013.2) to have original LAN as external on Fedora 19

*************************************
Update on 10/27/2013.  View also
*************************************

Neutron basic RDO setup (havana 2013.2) to have original LAN as external on Fedora 19 with native Ethernet interfaces names


 http://bderzhavets.blogspot.ru/2013/10/neutron-basic-rdo-setup-havana-20132-to_26.html

************************************

  Follow as normal   http://openstack.redhat.com/Quickstart, just after  

$ sudo yum install -y openstack-packstack run  $ sudo yum -y update  one more time to upgrade python-backports to 1.0.4 

Post install fix (as of 10/31/2013) :

Also set  ALLOWED_HOSTS = ['*']  in /etc/openstack-dashboard/local_settings and restart  httpd

When done switch to eth0 per
http://unix.stackexchange.com/questions/81834/how-can-i-change-the-default-ens33-network-device-to-old-eth0-on-fedora-19

    Remove biosdevname if it is installed. (yum remove biosdevname)
    Disable the udev rule:
      ln  -s /dev/null    /etc/udev/rules.d/80-net-name-slot.rules
    Reboot

and  create under /etc/sysconfig/network-scripts

[root@localhost network-scripts]# cat ifcfg-br-ex
DEVICE="br-ex"
BOOTPROTO="static"
IPADDR="192.168.1.125"
NETMASK="255.255.255.0"
DNS1="83.221.202.254"
BROADCAST="192.168.1.255"
GATEWAY="192.168.1.1"
NM_CONTROLLED="no"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="yes"
IPV6INIT=no
ONBOOT="yes"
TYPE="OVSBridge"
DEVICETYPE="ovs"


[root@localhost network-scripts]# cat ifcfg-eth0
NAME="eth0"
HWADDR=90:E6:BA:2D:11:EB
ONBOOT="yes"
TYPE="OVSPort"
DEVICETYPE="ovs"
OVS_BRIDGE=br-ex
NM_CONTROLLED=no
IPV6INIT=no

Enable network service, turn off interface eth0

********************************
UPDATE on 12/17/2013
********************************

It's working again



  

 

[root@openstack1 ~(keystone_admin)]# ovs-vsctl show
5e1fc460-3882-4210-b185-310e00af8a47
    Bridge br-int
        Port br-int
            Interface br-int
                type: internal
        Port "tapf7dd77e3-50"
            tag: 1
            Interface "tapf7dd77e3-50"
                type: internal
        Port "qr-33f43f85-da"
            tag: 1
            Interface "qr-33f43f85-da"
                type: internal
    Bridge br-ex
        Port "qg-161a8f7c-01"
            Interface "qg-161a8f7c-01"
                type: internal
        Port br-ex
            Interface br-ex
                type: internal
        Port "eth0\nbr-ex"
            Interface "eth0\nbr-ex"
        Port "eth0"
            Interface "eth0"
    ovs_version: "1.11.0"


**************************************************************************

Due to known bugs

Bug 981583 - Openstack firewall rules are not enabled after reboot
  https://bugzilla.redhat.com/show_bug.cgi?id=981583

Bug 981652 - firewalld does not cover openstack/packstack use case.    
  https://bugzilla.redhat.com/show_bug.cgi?id=981652

Run:-

# yum -y install iptables-services
# systemctl disable firewalld
# systemctl enable iptables

then  reboot

In dashboard environment delete router1 and public network.

# source keystonerc_admin
# nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0
# nova secgroup-add-rule default tcp 22 22 0.0.0.0/0
# neutron net-create public --router:external=True
# neutron subnet-create public 192.168.1.0/24 --name vlan --enable_dhcp False \
   --allocation_pool start=192.168.1.57,end=192.168.1.92  \
   --gateway 192.168.1.1
# neutron floatingip-create public

# EXTERNAL_NETWORK_ID=`neutron net-list | grep public | awk '{ print $2 }'`
# INT_SUBNET_ID=`neutron subnet-list | grep private_subnet | awk '{ print $2}'`
# SERVICE_TENANT_ID=`keystone tenant-list | grep service | awk '{ print $2}'`
# neutron router-create --name router2 --tenant-id $SERVICE_TENANT_ID router2
# neutron router-gateway-set router2  $EXTERNAL_NETWORK_ID
# neutron router-interface-add router2  $INT_SUBNET_ID
# neutron subnet-update $INT_SUBNET_ID --dns_nameservers list=true 83.221.202.254
# neutron subnet-update $INT_SUBNET_ID --gateway_ip 10.0.0.1

Create images via command line :-

# glance image-create --name 'Fedora19image' --disk-format qcow2 --container-format bare --is-public true \
--copy-from http://cloud.fedoraproject.org/fedora-19.x86_64.qcow2

# glance image-create --name 'UbuntuServer13.10image' \
  --disk-format qcow2 \
 --container-format bare --is-public true \
 --copy-from http://cloud-images.ubuntu.com/saucy/current/saucy-server-cloudimg-amd64-disk1.img

You can also fix the issue per

http://openstack.redhat.com/forum/discussion/554/havana-horizon-no-formats-available-for-images

Creating volumes on Havana release


By default (not to follow [1]) cinder-volumes VG gets created under
/var/lib/cinder as loop mounted empty file due to :-

[root@localhost ~(keystone_admin)]# cd /var/lib/cinder

[root@localhost cinder(keystone_admin)]# ls -l
total 16777236
-rw-r--r--. 1 root   root   22118662144 Oct  7 16:04 cinder-volumes
drwxr-xr-x. 2 cinder cinder        4096 Oct  7 15:48 tmp

[root@localhost cinder(keystone_admin)]# losetup -a

/dev/loop0: [64768]:6034065 (/srv/loopback-device/device1)
/dev/loop1: [64768]:918092 (/var/lib/cinder/cinder-volumes)


[root@localhost ~(keystone_admin)]# nova image-list
+--------------------------------------+------------------------+--------+--------+
| ID                                   | Name                   | Status | Server |
+--------------------------------------+------------------------+--------+--------+
| 73ddfddf-833d-4eda-869f-e26321c20a2e | Fedora19image  | ACTIVE |        |
| 2d5f5596-c5f5-401a-ae16-388b5dae78f2 | UbuntuServer13.10image | ACTIVE           
| 0415ec26-d202-4fb7-b6a0-3e7923547e98 | cirros                 | ACTIVE |        |
+--------------------------------------+------------------------+--------+--------+

[root@localhost ~(keystone_admin)]# cinder create --image-id 2d5f5596-c5f5-401a-ae16-388b5dae78f2  --display_name SalamanderVG 7

+---------------------+--------------------------------------+
|       Property      |                Value                 |
+---------------------+--------------------------------------+
|     attachments     |                  []                  |
|  availability_zone  |                 nova             |
|       bootable      |                False                 |
|      created_at     |      2013-10-07T11:39:32.001108      |
| display_description |                 None         |
|     display_name    |        SlamanderVG       |
|          id         | 624f7b78-bb1e-411a-afc6-e3190187af38 |
|       image_id      | 2d5f5596-c5f5-401a-ae16-388b5dae78f2 |
|       metadata      |                  {}                  |
|         size        |                  7                          |
|     snapshot_id     |                 None             |
|     source_volid    |                 None             |
|        status       |               creating               |
|     volume_type     |                 None            |
+---------------------+--------------------------------------+

[root@localhost ~(keystone_admin)]# nova volume-list
+--------------------------------------+-------------+--------------+------+-------------+-------------+
| ID                                   | Status      | Display Name | Size | Volume Type | Attached to |
+--------------------------------------+-------------+--------------+------+-------------+-------------+
| 624f7b78-bb1e-411a-afc6-e3190187af38 | downloading | SalamanderVG | 7    | None        |             |
+--------------------------------------+-------------+--------------+------+-------------+-------------+

[root@localhost ~(keystone_admin)]# cinder create --image-id 73ddfddf-833d-4eda-869f-e26321c20a2e  --display_name Fedora19VG 7

+---------------------+--------------------------------------+
|       Property      |                Value                 |
+---------------------+--------------------------------------+
|     attachments     |                  []                  |
|  availability_zone  |                 nova             |
|       bootable      |                False                 |
|      created_at     |      2013-10-07T11:42:32.708633      |
| display_description |                 None         |
|     display_name    |              Fedora19VG   |
|          id         | d2745ee6-9166-4ace-9fb6-826999eddcd0 |
|       image_id      | 73ddfddf-833d-4eda-869f-e26321c20a2e |
|       metadata      |                  {}                  |
|         size        |                  7                         |
|     snapshot_id     |                 None             |
|     source_volid    |                 None             |
|        status       |               creating               |
|     volume_type     |                 None             |
+---------------------+--------------------------------------+

[root@localhost ~(keystone_admin)]# nova volume-list

+--------------------------------------+-------------+--------------+------+-------------+-------------+
| ID                                   | Status      | Display Name | Size | Volume Type | Attached to |
+--------------------------------------+-------------+--------------+------+-------------+-------------+
| d2745ee6-9166-4ace-9fb6-826999eddcd0 | downloading | Fedora19VG   | 7    | None        |             |
| 624f7b78-bb1e-411a-afc6-e3190187af38  | available   | SalamanderVG     | 7   | None        |             |
+--------------------------------------+-------------+--------------+------+-------------+-------------+

[root@localhost ~(keystone_admin)]# nova volume-list

+--------------------------------------+--------+--------------+------+-------------+--------------------------------------+
| ID                                   | Status | Display Name | Size | Volume Type | Attached to                          |
+--------------------------------------+--------+--------------+------+-------------+--------------------------------------+
| d2745ee6-9166-4ace-9fb6-826999eddcd0 | in-use | Fedora19VG   | 7    | None        | 5dc6569f-42d8-49fb-a3d5-7f3089249952 |
| 624f7b78-bb1e-411a-afc6-e3190187af38 | in-use | SalamanderVG | 7    | None        | 3e0a32b4-1045-4d30-9921-b1c2c5140639 |
+--------------------------------------+--------+--------------+------+-------------+--------------------------------------+

[root@localhost ~(keystone_admin)]# pvscan | grep cinder-volumes
  PV /dev/loop1   VG cinder-volumes   lvm2 [20.60 GiB / 6.60 GiB free]





   Status of  RDO Havana 6 services


  





Cloud instance of Ubuntu 13.10 Server running Gnome 3.8.4 installed via  PPA    ppa:gnome3-team/gnome3 :
  1. $ sudo add-apt-repository ppa:gnome3-team/gnome3
  2. $ sudo apt-get update
  3. $sudo apt-get install gnome-shell ubuntu-gnome-desktop
View http://www.techrepublic.com/blog/linux-and-open-source/how-to-install-gnome-38-on-ubuntu/ regarding setup Gnome 3.8 on Ubuntu 13.04 (10)



REFERENCES

1. http://funwithlinux.net/2013/08/install-openstack-grizzly-on-fedora-19-using-packstack-with-quantum-networking/

 2. http://www.blog.sandro-mathys.ch/2013/08/install-rdo-havana-2-on-fedora-19-and.html

Monday, September 16, 2013

Quantum basic RDO setup (grizzly) to have original LAN as external on Fedora 19

Follow as normal http://openstack.redhat.com/Neutron-Quickstart
When done switch to eth0 per
http://unix.stackexchange.com/questions/81834/how-can-i-change-the-default-ens33-network-device-to-old-eth0-on-fedora-19

  1. Remove biosdevname if it is installed. (yum remove biosdevname)
  2. Disable the udev rule: ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules
  3. Reboot
and  create under /etc/sysconfig/network-scripts
[root@localhost network-scripts]# cat ifcfg-br-ex
DEVICE="br-ex"
BOOTPROTO="static"
IPADDR="192.168.1.52"
NETMASK="255.255.255.0"
DNS1="83.221.202.254"
BROADCAST="192.168.1.255"
GATEWAY="192.168.1.1"
NM_CONTROLLED="no"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="yes"
IPV6INIT=no
ONBOOT="yes"
TYPE="OVSBridge"
DEVICETYPE="ovs"

[root@localhost network-scripts]# cat ifcfg-eth0
NAME="eth0"
HWADDR=90:E6:BA:2D:11:EB
ONBOOT="no"
TYPE="OVSPort"
DEVICETYPE="ovs"
OVS_BRIDGE=br-ex
NM_CONTROLLED=no
IPV6INIT=no

Enable network service
REBOOT

Turn off interface eth0 , update ONBOOT="no" to ONBOOT="yes"
in ifcfg-eth0, then  restart network service





In dashboard environment delete router1 and public network.
Create router2 and internal interface to private network.

#   source keystonerc_admin
#   nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0
#   nova secgroup-add-rule default tcp 22 22 0.0.0.0/0
#   quantum net-create public --router:external=True
#   quantum subnet-create public 192.168.1.0/24 --name vlan \
     --enable_dhcp False --allocation_pool  \
     start=192.168.1.57, end=192.168.1.62  \
     --gateway 192.168.1.1
#  quantum floatingip-create public


Next step
# EXTERNAL_NETWORK_ID=`quantum net-list | grep public | awk '{ print $2 }'`
# quantum router-gateway-set router2  $EXTERNAL_NETWORK_ID
# INT_SUBNET_ID=`quantum subnet-list | grep private_subnet | awk '{ print $2}'`
# quantum subnet-update $INT_SUBNET_ID --dns_nameservers list=true 83.221.202.254
# quantum subnet-update $INT_SUBNET_ID --gateway_ip 10.0.0.1

 Router2 and internal interface to private network may be also created via CLI:

# EXTERNAL_NETWORK_ID=`quantum net-list | grep public | awk '{ print $2 }'`
# INT_SUBNET_ID=`quantum subnet-list | grep private_subnet | awk '{ print $2}'`
# SERVICE_TENANT_ID=`keystone tenant-list | grep service | awk '{ print $2}'`
# quantum router-create --name router2 --tenant-id $SERVICE_TENANT_ID router2
# quantum router-gateway-set router2  $EXTERNAL_NETWORK_ID
# quantum router-interface-add router2  $INT_SUBNET_ID
# quantum subnet-update $INT_SUBNET_ID --dns_nameservers list=true 83.221.202.254
# quantum subnet-update $INT_SUBNET_ID --gateway_ip 10.0.0.1

View  http://openstack.redhat.com/forum/discussion/196/quantum-basic-setup/p1



To make configuration persistent between reboots due to known bugs

Bug 981583 - Openstack firewall rules are not enabled after reboot
  https://bugzilla.redhat.com/show_bug.cgi?id=981583

Bug 981652 - firewalld does not cover openstack/packstack use case.     
  https://bugzilla.redhat.com/show_bug.cgi?id=981652

Run:-
 
# yum -y install iptables-services
# systemctl disable firewalld
# systemctl enable iptables








Cloud instance of Ubuntu 13.10 Server running Gnome 3.8.1 installed via  PPA    ppa:gnome3-team/gnome3 :
  1. $ sudo add-apt-repository ppa:gnome3-team/gnome3
  2. $ sudo apt-get update
  3. $sudo apt-get install gnome-shell ubuntu-gnome-desktop
View http://www.techrepublic.com/blog/linux-and-open-source/how-to-install-gnome-38-on-ubuntu/ regarding setup Gnome 3.8 on Ubuntu 13.04 (10)





Setup Windows Server 2012 evaluation cloud instance

# gunzip -cd windows_server_2012_standard_eval_kvm_20130510.qcow2.gz |
 glance image-create --property hypervisor_type=kvm --name "Windos Server2012 Std Eval"  --container-format bare --disk-format vhd


+--------------------------------------------+----------------------------------------+
| Property                              | Value                                |
+--------------------------------------------+----------------------------------------+
| Property 'hypervisor_type' | kvm                                  |
| checksum                            | 801d232ea89f74810284c88b1512a32a   
| container_format                | bare                                 |
| created_at                           | 2013-09-23T13:05:44       |
| deleted                                | False                                |
| deleted_at                           | None                                |
| disk_format                         | vhd                                   |
| id                                          | 32ae031d-3bc0-4a38-a355-f9a8fa8be6e6
| is_public                              | False                                |
| min_disk                              | 0                                       |
| min_ram                              | 0                                       |
| name                                   |  Windos Server 2012 Std Eval       

|owner                                   | f0001a9a94f741dfa1545f2682d01fde  
| protected                            | False                                 |
| size                                      | 16337731584                    |
| status                                  | active                                |
| updated_at                         | 2013-09-23T13:10:29        |
+-------------------------------------------+-----------------------------------------+

Getting password for Admin :

# nova list
+--------------------------------------+----------------+-----------+--------------------------------------------+
| ID                                    | Name      | Status  | Networks                            |
+--------------------------------------+----------------+-----------+--------------------------------------------+
| c0b65e09-7195-4c10-bce3-2c4c7aca7cea | UbuntuSRV13.10 | SUSPENDED | InternalNetwork=192.168.12.2, 192.168.1.62 |
| 019ce45c-5586-4e46-8db0-68cfc9777049 | VF19BD         | SUSPENDED | private=10.0.0.3, 192.168.1.58             |
| 59070632-c37d-4a60-8ee7-9bc4db3960ed | WinSRV2012     | SUSPENDED | private=10.0.0.4, 192.168.1.59             |
+--------------------------------------+----------------+-----------+--------------------------------------------+

# nova get-password   WinSRV2012 /home/boris/Downloads/key2.pem



Remote noVNC access to cloud instances

[root@localhost ~(keystone_admin)]# nova list
+--------------------------------------+------------+-----------+--------------------------------+
| ID                                   | Name       | Status    | Networks                       |
+--------------------------------------+------------+-----------+--------------------------------+
| 27616e5c-a08d-4c18-8366-038a03dec77c | Ubuntu1310 | ACTIVE    | private=10.0.0.6, 192.168.1.63 |
| ca57df26-ae59-4ea0-a9c3-b21b1e862947 | VF19BD     | SUSPENDED | private=10.0.0.3, 192.168.1.59 |
| d37ccd48-0ba4-4e28-aa0b-eb43deb8b948 | WinSRV2012 | ACTIVE    | private=10.0.0.5, 192.168.1.61 |
+--------------------------------------+------------+-----------+--------------------------------+
[root@localhost ~(keystone_admin)]# nova get-vnc-console 27616e5c-a08d-4c18-8366-038a03dec77c novnc
+-------+------------------------------------------------------------------------------------+
| Type  | Url                                                                                |
+-------+------------------------------------------------------------------------------------+
| novnc | http://192.168.1.145:6080/vnc_auto.html?token=8a6dbade-e4f0-4c6d-8ee7-dab8bb34fa32 |
+-------+------------------------------------------------------------------------------------+
[root@localhost ~(keystone_admin)]# nova get-vnc-console d37ccd48-0ba4-4e28-aa0b-eb43deb8b948 novnc
+-------+------------------------------------------------------------------------------------+
| Type  | Url                                                                                |
+-------+------------------------------------------------------------------------------------+
| novnc | http://192.168.1.145:6080/vnc_auto.html?token=796ef47d-ecb7-40c2-be0f-032f85afe445 |
+-------+------------------------------------------------------------------------------------+







Sunday, September 15, 2013

Quantum basic RDO setup (grizzly) to have original LAN as external on CentOS 6.4

Attempting to follow http://allthingsopen.com/2013/08/23/openstack-packstack-installation-with-external-connectivity/I've got an error after starting :-
# packstack --allinone --quantum-l3-ext-bridge=eth0
It reports that ovs port eth0 already exists. Approach bellow in general follows RDO's  discussion
at http://openstack.redhat.com/forum/discussion/196/quantum-basic-setup/p1
Follow as normal http://openstack.redhat.com/Neutron-Quickstart
When done create under /etc/sysconfig/network-scripts


[root@Server64 network-scripts]# cat ifcfg-br-ex
DEVICE="br-ex"
BOOTPROTO="none"
IPADDR="192.168.1.42"
NETMASK="255.255.255.0"
DNS1="83.221.202.254"
BROADCAST="192.168.1.255"
GATEWAY="192.168.1.1"
NM_CONTROLLED="no"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="yes"
IPV6INIT=no
ONBOOT="yes"
TYPE="OVSBridge"
DEVICETYPE="ovs"

[root@Server64 network-scripts]# cat ifcfg-eth0
DEVICE="eth0"
ONBOOT="yes"
# HWADDR="1C:C1:DE:76:19:70"
HWADDR="00:22:15:63:E4:E2"
TYPE="OVSPort"
DEVICETYPE="ovs"
OVS_BRIDGE=br-ex
NM_CONTROLLED=no
IPV6INIT=no

Run script as root :-

for i in /etc/quantum/*.ini
do
    sed -i "s/^[# ]*ovs_use_veth.*$/ovs_use_veth = True/g" $i
done

sed -i \
    -e "s/^[# ]*enable_isolated_metadata.*$/enable_isolated_metadata = True/g" \
    -e "s/^[# ]*enable_metadata_network.*$/enable_metadata_network = True/g"  \
    /etc/quantum/dhcp_agent.ini


# chkconfig network on

REBOOT
Disable autoconnect eth0.
REBOOT

Remove old puplic (external network) and create new one as required.
Recreate router in dashboard environment and add internal interface to
private network

#   source keystonerc_admin
#   nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0
#   nova secgroup-add-rule default tcp 22 22 0.0.0.0/0
#   quantum net-create public --router:external=True
#   quantum subnet-create public 192.168.1.0/24 --name vlan --enable_dhcp False --allocation_pool start=192.168.1.57,end=192.168.1.62 \
    --  gateway 192.168.1.1
#   quantum floatingip-create public

#   quantum net-list
[root@Server64 ~(keystone_admin)]# quantum router-list
+--------------------------------------+---------+--------------------------------------------------------+
| id                                   | name    | external_gateway_info                   |
+--------------------------------------+---------+--------------------------------------------------------+
| c56c1cc1-a11b-454c-9ccb-17dc7e62f475 | router1 |
+--------------------------------------+---------+--------------------------------------------------------+

[root@Server64 ~(keystone_admin)]# quantum net-list
+--------------------------------------+---------+-----------------------------------------------------+
| id                                   | name    | subnets                                       |
+--------------------------------------+---------+-----------------------------------------------------+
| 6823b670-231c-4b31-9325-12dc098087b2 | private | 203320cc-cd60-486d-b092-eec99740c4cc 10.0.0.0/24    |
| c9615975-beb4-461a-9aad-b740a3350bf5 | public  | 40568df0-9bae-4578-8ae9-56d0ae7d4a2e 192.168.1.0/24 |
+--------------------------------------+---------+-----------------------------------------------------+

#   quantum router-gateway-set c56c1cc1-a11b-454c-9ccb-17dc7e62f475 c9615975-beb4-461a-9aad-b740a3350bf5

[root@Server64 ~(keystone_admin)]# quantum subnet-list
+--------------------------------------+----------------+----------------+--------------------------------------------------+
| id                                   | name           | cidr           | allocation_pools                                 |
+--------------------------------------+----------------+----------------+--------------------------------------------------+
| 203320cc-cd60-486d-b092-eec99740c4cc | private_subnet | 10.0.0.0/24    | {"start": "10.0.0.2", "end": "10.0.0.254"}       |
| 40568df0-9bae-4578-8ae9-56d0ae7d4a2e | vlan           | 192.168.1.0/24 | {"start": "192.168.1.57", "end": "192.168.1.62"} |
+--------------------------------------+----------------+----------------+--------------------------------------------------+

[root@Server64 ~(keystone_admin)]#  quantum subnet-update 203320cc-
cd60-486d-b092-eec99740c4cc  --dns_nameservers list=true 83.221.202.254
Updated subnet: 203320cc-cd60-486d-b092-eec99740c4cc

[root@RServer64 ~(keystone_admin)]#  quantum subnet-update 203320cc-cd60-486d-b092-eec99740c4cc  --gateway_ip 10.0.0.1
Updated subnet: 203320cc-cd60-486d-b092-eec99740c4cc


 In other way it may look like :-

# EXTERNAL_NETWORK_ID=`quantum net-list | grep public | awk '{ print $2 }'`
# quantum router-gateway-set router1 $EXTERNAL_NETWORK_ID
# INT_SUBNET_ID=`quantum subnet-list | grep private_subnet | awk '{ print $2}'`
# quantum subnet-update $INT_SUBNET_ID --dns_nameservers list=true 83.221.202.254
# quantum subnet-update $INT_SUBNET_ID --gateway_ip 10.0.0.1














References
1.http://openstack.redhat.com/forum/discussion/196/quantum-basic-setup

Saturday, March 17, 2012


Set up Spice-Gtk 0.11 with USB redirection on Ubuntu Precise



Build requires spice-protocol 0.10.1 and the most recent usbredir 0.4.2
View also recent commit at http://cgit.freedesktop.org/spice/spice-gtk/ converted to 0001-usbredir-Check-for-existing-usb-channels-after-libus.patch for spice-gtk-0.11

****************
Link to PPA
****************

$ sudo add-apt-repository ppa:bderzhavets/lib-usbredir68
$ sudo apt-get update
$ sudo apt-get install qemu-kvm qemu qemu-common qemu-utils \
spice-client libusb-1.0-0 libusb-1.0-0-dev \
libusbredir libusbredir-dev usbredir-server \
libspice-protocol-dev libspice-server-dev \
libspice-client-glib-2.0-1 libspice-client-glib-2.0-dev \
libspice-client-gtk-2.0-1 libspice-client-gtk-2.0-dev \
libspice-client-gtk-3.0-1 libspice-client-gtk-3.0-dev \
python-spice-client-gtk spice-client-gtk

$ sudo groupadd libvirtd
$ sudo adduser $USER libvirtd
RELOGIN
$ sudo apt-get install virtinst virt-manager virt-viewer
$ sudo ln -s /etc/apparmor.d/usr.sbin.libvirtd /etc/apparmor.d/disable/

To start default network :-

sudo virsh net-start default
sudo virsh net-autostart default

Wednesday, January 18, 2012


Set up Spice-Gtk 0.8 (USB Redirection support) on Ubuntu Precise



Short list of the changes per [1] :

- add USB redirection support, see Hans comments in the log and that
post for details: http://hansdegoede.livejournal.com/11084.html
- introduce SpiceGtkSession to deal with session-wide Gtk events, such
as clipboard, instead of doing it per display
- many cursor and keyboard handling improvements
- handle the new "semi-seamless" migration
- support new Spice mini-headers
- better coroutines: fibers on windows & jmp on linux
- add Vala vapi bindings generation
- many bug fixes and code improvements


Build requires spice-protocol 0.10.1 and the most recent usbredir 0.3.3
******************************************************************************************
Link to PPA Qemu-kvm 1.0 & Spice-protocol 0.10.1 & Spice-Gtk 0.8 USB Redirection on Ubuntu Precise
View also PPA Set up Spice-Gtk 0.8 on Ubuntu Precise
******************************************************************************************
$ sudo add-apt-repository ppa:bderzhavets/lib-usbredir58
$ sudo apt-get update
$ sudo apt-get install qemu-kvm qemu qemu-common qemu-utils \
spice-client libusb-1.0-0 libusb-1.0-0-dev \
libusbredir libusbredir-dev usbredir-server \
libspice-protocol-dev libspice-server-dev \
libspice-client-glib-2.0-4 libspice-client-glib-2.0-dev \
libspice-client-gtk-2.0-1 libspice-client-gtk-2.0-dev \
libspice-client-gtk-3.0-1 libspice-client-gtk-3.0-dev \
python-spice-client-gtk spice-client-gtk

$ sudo groupadd libvirtd
$ sudo adduser $USER libvirtd
RELOGIN
$ sudo apt-get install virtinst virt-manager virt-viewer
$ sudo ln -s /etc/apparmor.d/usr.sbin.libvirtd /etc/apparmor.d/disable/

To start default network :-

sudo virsh net-start default
sudo virsh net-autostart default

Works with QEMU-KVM 1.0 with no special patch

1.http://www.mail-archive.com/spice-devel@lists.freedesktop.org/msg06659.html

Friday, January 13, 2012

Tuesday, December 06, 2011


Qemu-kvm 1.0 & Spice 0.10.0 & Spice-Gtk-0.7.81 USB redirection for Ubuntu Precise, Oneiric and Linux Mint 12 (Lisa)



Following bellow is attempt to reproduce Hans de Goede blog entry at http://planet.spice-space.org/ on Ubuntu 12.04 and 11.10 with intend to build Qemu-kvm 1.0 with usb redirection network support per http://planet.spice-space.org/. Current build qemu-kvm for Ubuntu Precise is based on branch http://cgit.freedesktop.org/~jwrdegoede/qemu/.
View similar PPA for Ubuntu Oneiric and Linux Mint 12 (Lisa) Qemu-kvm 1.0 & Spice 0.10.0 & Spice-Gtk-0.7.81 USB redirection and Libvirt 0.9.7-2 for Ubuntu Oneiric(v.6).
Spice-Gtk-0.7.81 has been built up on current snapshot of git://anongit.freedesktop.org/spice/spice-gtk to obtain Spice-Gtk with usb redirection support working stable with Spice 0.10.0.

Builds have been done on Ubuntu Precise and Oneiric as well.Packaged version version of Spice-Gtk-0.7.81 is built up on mentioned git repository. Running autogen.sh with exported environment variable NOCONFIGURE allows to perform it in one build per Debian’s Spice-Gtk-0.7-3 building schema, however requiring several updates to debian/control and debian/rules due to snapshots have to be done from current git tree.Upgrade version of Libvirt up to 0.9.7-2 allows to avoid using “qemu” command line (libvirt 0.9.2) and follow http://planet.spice-space.org/ update VM’s XML profile under /etc/libvirt/qemu/ as suggested in second blog entry of Hans de Goede.

$ git clone git://people.freedesktop.org/~jwrdegoede/qemu
$ cd qemu
$ git checkout -B qemu-kvm-1.0-usbredir origin/qemu-kvm-1.0-usbredir
$ cd ..
$ cp -R qemu qemu-kvm-1.0-usbredir

Intermediate release :-

http://cgit.freedesktop.org/~jwrdegoede/qemu/log/?h=qemu-kvm-1.0-usbredir

clearly demonstrates that all usb redirection patches won’t be in Qemu-kvm 1.0 release

Libusb build is based on git://git.libusb.org/libusb.git – 1.0.9-rc1
libusb-1.0.9-rc1 release candidate.

Qemu-kvm 1.0-rc2 debian/rules contains:-

./configure \
–target-list=”x86_64-softmmu i386-softmmu x86_64-linux-user i386-linux-user” \
–prefix=/usr \
–interp-prefix=/etc/qemu-binfmt/%M \
–disable-blobs \
–disable-strip \
–enable-spice \
–enable-usb-redir \
$(conf_arch)

VirtFS support is available.

**********************************************
To install packages from Precise PPA
**********************************************
$ sudo add-apt-repository ppa:bderzhavets/lib-usbredir38
$ sudo apt-get update
$ sudo apt-get install qemu-kvm qemu qemu-common \
spice-client libusb-1.0-0 libusb-1.0-0-dev \
libusbredir libusbredir-dev \
libspice-protocol-dev libspice-server-dev \
libspice-client-glib-2.0-4 libspice-client-glib-2.0-dev \
libspice-client-gtk-2.0-1 libspice-client-gtk-2.0-dev \
libspice-client-gtk-3.0-1 libspice-client-gtk-3.0-dev \
python-spice-client-gtk spice-client-gtk \
gir1.2-spice-client-glib-2.0 \
gir1.2-spice-client-gtk-2.0 \
gir1.2-spice-client-gtk-3.0

$ sudo apt-get install virtinst virt-manager virt-viewer
$ sudo adduser $USER libvirtd
$ sudo ln -s /etc/apparmor.d/usr.sbin.libvirtd /etc/apparmor.d/disable/

Successful install looks like :-

boris@UbuntuPrecise:~$ dpkg -l |grep libspice
ii libspice-client-glib-2.0-4 0.7.81~4f76-2ubuntu6 GObject for communicating with Spice servers (runtime library)
ii libspice-client-glib-2.0-dev 0.7.81~4f76-2ubuntu6 GObject for communicating with Spice servers (development files)
ii libspice-client-gtk-2.0-1 0.7.81~4f76-2ubuntu6 GTK2 widget for SPICE clients (runtime library)
ii libspice-client-gtk-2.0-dev 0.7.81~4f76-2ubuntu6 GTK2 widget for SPICE clients (development files)
ii libspice-client-gtk-3.0-1 0.7.81~4f76-2ubuntu6 GTK3 widget for SPICE clients (runtime library)
ii libspice-client-gtk-3.0-dev 0.7.81~4f76-2ubuntu6 GTK3 widget for SPICE clients (development files)
ii libspice-protocol-dev 0.10.0-2ubuntu2 SPICE protocol headers
ii libspice-server-dev 0.10.0-2ubuntu7 Header files and development documentation for spice-server
ii libspice-server1 0.10.0-2ubuntu7 Implements the server side of the SPICE protocol

boris@UbuntuPrecise:~$ dpkg -l |grep qemu
ii qemu 1.0-usbredir-2ubuntu3 dummy transitional package from qemu to qemu-kvm
ii qemu-common 1.0-usbredir-2ubuntu3 qemu common functionality (bios, documentation, etc)
ii qemu-kvm 1.0-usbredir-2ubuntu3 Full virtualization on i386 and amd64 hardware

boris@UbuntuPrecise:~$ dpkg -l |grep libvirt
ii libvirt-bin 0.9.7-2ubuntu2 programs for the libvirt library
ii libvirt0 0.9.7-2ubuntu2 library for interfacing with different virtualization systems
ii python-libvirt 0.9.7-2ubuntu2 libvirt Python bindings

Per Hans de Goede – first create file /etc/qemu/ich9-ehci-uhci.cfg



[device "ehci"]
driver = "ich9-usb-ehci1"
addr = "1d.7"
multifunction = "on"

[device "uhci-1"]
driver = "ich9-usb-uhci1"
addr = "1d.0"
multifunction = "on"
masterbus = "ehci.0"
firstport = "0"

[device "uhci-2"]
driver = "ich9-usb-uhci2"
addr = "1d.1"
multifunction = "on"
masterbus = "ehci.0"
firstport = "2"

[device "uhci-3"]
driver = "ich9-usb-uhci3"
addr = "1d.2"
multifunction = "on"
masterbus = "ehci.0"
firstport = "4"


Upgrade version of Libvirt up to 0.9.7 allows to avoid using “qemu” command line (libvirt 0.9.2) and follow http://planet.spice-space.org/ update VM’s XML profile under /etc/libvirt/qemu/ as suggested in second blog entry of Hans de Goede (September 09, 2011):-
Change the first line from:



<domain type='kvm'>


to:



<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>


And add the following lines at the end, above the “</domain>” line:



<qemu:commandline>
<qemu:arg value='-readconfig'/>
<qemu:arg value='/etc/qemu/ich9-ehci-uhci.cfg'/>
<qemu:arg value='-chardev'/>
<qemu:arg value='spicevmc,name=usbredir,id=usbredirchardev1'/>
<qemu:arg value='-device'/>
<qemu:arg value='usb-redir,chardev=usbredirchardev1,id=usbredirdev1,bus=ehci.0,debug=3'/>
<qemu:arg value='-chardev'/>
<qemu:arg value='spicevmc,name=usbredir,id=usbredirchardev2'/>
<qemu:arg value='-device'/>
<qemu:arg value='usb-redir,chardev=usbredirchardev2,id=usbredirdev2,bus=ehci.0,debug=3'/>
<qemu:arg value='-chardev'/>
<qemu:arg value='spicevmc,name=usbredir,id=usbredirchardev3'/>
<qemu:arg value='-device'/>
<qemu:arg value='usb-redir,chardev=usbredirchardev3,id=usbredirdev3,bus=ehci.0,debug=3'/>
</qemu:commandline>


Then run :-
# /etc/init.d/libvirt-bin restart















Tuesday, November 15, 2011


Qemu-kvm 0.15.1 & Spice(0.10.0) & Libvirt 0.9.7-2 USB Redirection support for Ubuntu Precise and Oneiric



*****************************************************************************************
Update on 11/29/2011 . View also build based on Qemu-kvm-1.0-rc2
*****************************************************************************************
$ gir clone git://people.freedesktop.org/~jwrdegoede/qemu
$ cd qemu
$ git checkout -B qemu-kvm-1.0-usbredir origin/qemu-kvm-1.0-usbredir
$ cp -R qemu qemu-kvm-1.0-usbredir
Libusb build is based on git://git.libusb.org/libusb.git - 1.0.9-rc1
libusb-1.0.9-rc1 release candidate
Qemu-kvm 1.0 & Spice 0.10.0 & Spice-Gtk-0.7.81 USB redirection for Ubuntu Precise (v.6)
*****************************************************************************************
Following bellow is attempt to reproduce Hans de Goede blog entry at http://planet.spice-space.org/ on Ubuntu 12.04 and 11.10 with intend to build Qemu-kvm 0.15.1 with usb redirection network support per http://planet.spice-space.org/ via git repository git://people.freedesktop.org/~jwrdegoede/qemu.
Qemu-kvm 0.15.1 has been patched via top 28 commits from

http://cgit.freedesktop.org/~jwrdegoede/qemu/log/?h=qemu-kvm-0.15.0-usbredir

Patches set for debian build may be generated as follows :
$ git clone git://people.freedesktop.org/~jwrdegoede/qemu
$ cd qemu
$ git checkout -B qemu-kvm-0.15.0-usbredir origin/qemu-kvm-0.15.0-usbredir
$ mkdir -p /tmp/patches
$ git format-patch -M -C –output-directory \
/tmp/patches ea2798c1ebe0c12d5feb7d7471a999ea0671ef2f

Spice-Gtk-0.7.81 has been built up on current snapshot of git://anongit.freedesktop.org/spice/spice-gtk to obtain Spice-Gtk with usb redirection support working stable with Spice 0.10.0. Builds have been done on Ubuntu Precise and Oneiric as well.Packaged version version of Spice-Gtk-0.7.81 is built up on mentioned git repository. Running autogen.sh with exported environment variable NOCONFIGURE allows to perform it in one build per Debian’s Spice-Gtk-0.7-3 building schema, however requiring several updates to debian/control and debian/rules due to snapshots have to be done from current git tree.Upgrade version of Libvirt up to 0.9.7-2 allows to avoid using “qemu” command line (libvirt 0.9.2) and follow http://planet.spice-space.org/ update VM’s XML profile under /etc/libvirt/qemu/ as suggested in second blog entry of Hans de Goede.
Per Daniel Berrange: In the same way that SSH allows you to setup hostname aliases in $HOME/.ssh/config, libvirt will now allow you to setup URI aliases in $HOME/.libvirt/libvirt.conf (if you are running unprivileged) or /etc/libvirt/libvirt.conf (if you are running as root). NB do not confuse this file with libvirtd.conf which is a server side libvirtd daemon config file. Due to spice upgrade users should be able to run Spice server on 32-bit OS (Precise daily builds)
******************************************************************************************
Qemu-kvm 0.15.1 & Spice(0.10.0) & Libvirt 0.9.7-2 USB Redirection support for Ubuntu Oneiric Link for Oneiric PPA.
******************************************************************************************
Qemu-kvm 0.15.1 has been patched via top 28 commits from
http://cgit.freedesktop.org/~jwrdegoede/qemu/log/?h=qemu-kvm-0.15.0-usbredir

Patches set for debian build may be generated as follows :
$ git clone git://people.freedesktop.org/~jwrdegoede/qemu
$ cd qemu
$ git checkout -B qemu-kvm-0.15.0-usbredir origin/qemu-kvm-0.15.0-usbredir
$ mkdir -p /tmp/patches
$ git format-patch -M -C --output-directory \
/tmp/patches ea2798c1ebe0c12d5feb7d7471a999ea0671ef2f

Qemu-kvm debian/rules contains:-

./configure \
--target-list="x86_64-softmmu i386-softmmu x86_64-linux-user i386-linux-user" \
--prefix=/usr \
--interp-prefix=/etc/qemu-binfmt/%M \
--disable-blobs \
--disable-strip \
--enable-spice \
--enable-usb-redir \
$(conf_arch)

VirtFS support is available.

***************************************
To install packages from PPA
***************************************
$ sudo add-apt-repository ppa:bderzhavets/spice-010
$ sudo apt-get update
$ sudo apt-get install qemu-kvm qemu qemu-common \
spice-client seabios \
libusb-1.0-0 libusb-1.0-0-dev \
libusbredir libusbredir-dev \
libspice-protocol-dev libspice-server-dev \
libspice-client-glib-2.0-4 libspice-client-glib-2.0-dev \
libspice-client-gtk-2.0-1 libspice-client-gtk-2.0-dev \
libspice-client-gtk-3.0-1 libspice-client-gtk-3.0-dev \
python-spice-client-gtk spice-client-gtk \
gir1.2-spice-client-glib-2.0 \
gir1.2-spice-client-gtk-2.0 \
gir1.2-spice-client-gtk-3.0

$ sudo groupadd libvirtd
$ sudo adduser $USER libvirtd

RELOGIN

$ sudo apt-get install virtinst virt-manager virt-viewer

To start default network :-

sudo virsh net-start default
sudo virsh net-autostart default

You might have to disable apparmor profile for libvirtd :-

$ sudo ln -s /etc/apparmor.d/usr.sbin.libvirtd /etc/apparmor.d/disable/
$ sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.libvirtd









Tuesday, October 18, 2011


Set up Qemu&Spice&Libvirt 0.9.6 USB Redirection on Ubuntu 11.10 (Oneiric Ocelot)



Following bellow is attempt to reproduce Hans de Goede blog entry at http://planet.spice-space.org/ on Ubuntu 11.10 with intent to build Qemu-kvm 0.15.0 with usb redirection network support per http://planet.spice-space.org/ via git repository git://people.freedesktop.org/~jwrdegoede/qemu :-

$ git clone git://people.freedesktop.org/~jwrdegoede/qemu
$ cd qemu
$ git checkout -B qemu-kvm-0.15.0-usbredir origin/qemu-kvm-0.15.0-usbredir
$ git log|more

Spice-Gtk-0.7.61 has been built up on current snapshot of git://anongit.freedesktop.org/spice/spice-gtk to obtain Spice-Gtk with usb redirection support working stable with Spice 0.9.1. Build done on Ubuntu Oneiric.Packaged version version of Spice-Gtk-0.7.61 is built up on mentioned git repository via Debian's 0.7-3 schema. Libusb-1.0-2:1.0.9-3ubuntu9 is built up on git://people.freedesktop.org/~jwrdegoede/libusb (pre 1.0.9). Usbredir-0.3.1-1ubuntu5 is built up on official release usbredir-0.3.1.tar.gz.

Qemu-kvm debian/rules contains:-

./configure \
--target-list="x86_64-softmmu i386-softmmu x86_64-linux-user i386-linux-user" \
--prefix=/usr \
--interp-prefix=/etc/qemu-binfmt/%M \
--disable-blobs \
--disable-strip \
--enable-spice \
--enable-usb-redir \
$(conf_arch)

Spicy should be run by root, view http://planet.spice-space.org/. Make sure you’ve done on server

$ sudo apt-get install ipxe

Per Hans de Goede :-
Select the options menu entry and make sure that the “auto redirect newly plugged in USB devices” option is checked. After this make sure the vm has keyboard focus (so close the options menu), plug in a new USB device and watch it show up in your vm





**************************************
To install packages from PPA
**************************************
$ sudo add-apt-repository ppa:bderzhavets/lib-usbredir19
$ sudo apt-get update
$ sudo apt-get install qemu-kvm qemu qemu-common \
spice-client seabios \
libusb-1.0-0 libusb-1.0-0-dev \
libusbredir libusbredir-dev \
libspice-protocol-dev libspice-server-dev \
libspice-client-glib-2.0-4 libspice-client-glib-2.0-dev \
libspice-client-gtk-2.0-1 libspice-client-gtk-2.0-dev \
libspice-client-gtk-3.0-1 libspice-client-gtk-3.0-dev \
python-spice-client-gtk spice-client-gtk \
gir1.2-spice-client-glib-2.0 \
gir1.2-spice-client-gtk-2.0 \
gir1.2-spice-client-gtk-3.0

$ sudo apt-get install virtinst virt-manager virt-viewer

You might have to disable apparmor profile for libvirtd

$ sudo ln -s /etc/apparmor.d/usr.sbin.libvirtd /etc/apparmor.d/disable/
$ sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.libvirtd
$ sudo adduser $USER kvm

Upgrade libvirt up to 0.9.6

sudo apt-get install libvirt-bin libvirt-dev libvirt-doc \
libvirt0 libvirt0-dbg python-libvirt libxen-dev

To start default network :-

sudo virsh net-start default
sudo virsh net-autostart default

After libvirt upgrade virsh will support of Qemu&Spice USB Redirection.It allows follow http://planet.spice-space.org/ update VM’s XML profile under /etc/libvirt/qemu/ as suggested in second blog entry of Hans de Goede :-

Change the first line from: <domain type=’kvm’> to:

<domain type=’kvm’ xmlns:qemu=’http://libvirt.org/schemas/domain/qemu/1.0′>

And add the following lines at the end, above the “</domain>” line: <qemu:commandline>

<qemu:arg value=’-readconfig’/>
<qemu:arg value=’/etc/qemu/ich9-ehci-uhci.cfg’/>
<qemu:arg value=’-chardev’/>
<qemu:arg value=’spicevmc,name=usbredir,id=usbredirchardev1′/>
<qemu:arg value=’-device’/>
<qemu:arg value=’usb-redir,chardev=usbredirchardev1,id=usbredirdev1,bus=ehci.0,debug=3′/>
<qemu:arg value=’-chardev’/>
<qemu:arg value=’spicevmc,name=usbredir,id=usbredirchardev2′/>
<qemu:arg value=’-device’/>
<qemu:arg value=’usb-redir,chardev=usbredirchardev2,id=usbredirdev2,bus=ehci.0,debug=3′/>
<qemu:arg value=’-chardev’/>
<qemu:arg value=’spicevmc,name=usbredir,id=usbredirchardev3′/>
<qemu:arg value=’-device’/>
<qemu:arg value=’usb-redir,chardev=usbredirchardev3,id=usbredirdev3,bus=ehci.0,debug=3′/>
</qemu:commandline>

Then run :-

# /etc/init.d/libvirt-bin restart

Manage VMs via virsh or Virt Manager having USB redirection support active in Spicy’s sessions.









Thursday, October 13, 2011


Set up Qemu&Spice USB Redirection support on Ubuntu 11.10 (Oneiric).



***************************************************************************************
UPDATE on 10/14/2011. Oops ! Works on final release Ubuntu 11.10 .
I forgot, that Per Hans de Goede :-
Select the options menu entry and make sure that the “auto redirect newly plugged in USB devices” option is checked. After this make sure the vm has keyboard focus (so close the options menu), plug in a new USB device and watch it show up in your vm





***************************************************************************************
I have been working on it for the most recent two weeks debianizing stuff
from Hans de Goede blog entry at http://planet.spice-space.org/

View PPAs :

ppa:bderzhavets/lib-usbredir15
ppa:bderzhavets/lib-usbredir16
ppa:bderzhavets/lib-usbredir17
ppa:bderzhavets/lib-usbredir18

utilizing daily builds of Oneric.
Install :-
Qemu-kvm 0.15 with usbredir support has been built per http://planet.spice-space.org/
via Hans de Goede git repository:-

$ git clone git://people.freedesktop.org/~jwrdegoede/qemu
$ cd qemu
$ git checkout -B qemu-kvm-0.15.0-usbredir origin/qemu-kvm-0.15.0-usbredir
$ git log|more

Qemu-kvm debian/rules contains:-

./configure \
--target-list="x86_64-softmmu i386-softmmu x86_64-linux-user i386-linux-user" \
--prefix=/usr \
--interp-prefix=/etc/qemu-binfmt/%M \
--disable-blobs \
--disable-strip \
--enable-spice \
--enable-usb-redir \
$(conf_arch)

Spicy should be run by root, view http://planet.spice-space.org/

Spice-Gtk-0.7.6X follows Debian's 0.7-3 packaging schema

*****************************
To install packages from PPA
*****************************
$ sudo add-apt-repository ppa:bderzhavets/lib-usbredir18
$ sudo apt-get update
$ sudo apt-get install qemu-kvm qemu qemu-common \
spice-client seabios \
libusb-1.0-0 libusb-1.0-0-dev \
libusbredir libusbredir-dev \
libspice-protocol-dev libspice-server-dev \
libspice-client-glib-2.0-4 libspice-client-glib-2.0-dev \
libspice-client-gtk-2.0-1 libspice-client-gtk-2.0-dev \
libspice-client-gtk-3.0-1 libspice-client-gtk-3.0-dev \
python-spice-client-gtk spice-client-gtk \
gir1.2-spice-client-glib-2.0 \
gir1.2-spice-client-gtk-2.0 \
gir1.2-spice-client-gtk-3.0

$ sudo apt-get install virtinst virt-manager virt-viewer

You might have to disable apparmor profile for libvirtd

$ sudo ln -s /etc/apparmor.d/usr.sbin.libvirtd /etc/apparmor.d/disable/
$ sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.libvirtd
$ sudo adduser $USER kvm



Shift + Left click to view the picture in details . It's important








USB pen plugged in and redirected to KVM locally :








In this case KVM Server with usb network redirection enabled and Spice-Gtk-0.7.60 are
running on the same instance on Oneiric . But network redirection also works fine . View :-


http://bderzhavets.wordpress.com/2011/10/09/usb-redirection-on-ubuntu-11-10-oneiric/


Qemu&Spice USB redirection does work on final release of Ubuntu 11.10.

Saturday, July 23, 2011


Build Xen 4.1.1 on Ubuntu 11.10


View PPA :-

Xen 4.1.1 on Ubuntu 11.10

Description

Build Xen 4.1.1 with patch http://xenbits.xen.org/hg/xen-4.1-testing.hg/rev/1976adbf2b80 (changeset 23104:1976adbf2b80 ). CS upstream-23044:d4ca456c0c25 removed from series. I understand that to remove it on Ubuntu i have to revert it explicitly. However, for now upstream-23044:d4ca456c0c25 seems to be harmless and not connected to the core issue (hvmloader broken by GCC 4.6) fixed by changeset 23104:1976adbf2b80 . The rest of patchque is the same.
Build is based on https://launchpad.net/ubuntu/+source/xen/4.1.1-1ubuntu1

Monday, July 18, 2011


Set up F15 PV DomU at Xen 4.1 (kernel 3.0.0-5-generic) Dom0 on Ubuntu Oneiric



Following bellow is the first attempt to create PV domain at stock Xen 4.1 Dom0 on top Ubuntu Oneiric (alpha2 +) running kernel 3.0.0-5-generic. One bug in system configuration was fixed after initial install. I added to /etc/modules:


xen-gntdev
xen-blkback
xen-netback


Before you begin make sure

root@boris-P5Q-E:~# ls -l /dev/xen
total 0
crw------- 1 root root 10, 55 2011-07-19 08:02 evtchn
crw------- 1 root root 10, 56 2011-07-19 08:01 gntdev
root@boris-P5Q-E:~# lsmod |grep xen
xen_evtchn 13172 1
xenfs 18311 1
xen_blkback 23177 0 [permanent]
xen_netback 27854 0 [permanent]
xen_gntdev 17676 0
root@boris-P5Q-E:~# xm info
host : boris-P5Q-E
release : 3.0.0-5-generic
version : #6-Ubuntu SMP Tue Jul 12 05:21:50 UTC 2011
machine : x86_64
nr_cpus : 2
nr_nodes : 1
cores_per_socket : 2
threads_per_core : 1
cpu_mhz : 2999
hw_caps : bfebfbff:20100800:00000000:00000940:0008e3fd:00000000:00000001:00000000
virt_caps : hvm
total_memory : 8191
free_memory : 2078
free_cpus : 0
xen_major : 4
xen_minor : 1
xen_extra : .0
xen_caps : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64
xen_scheduler : credit
xen_pagesize : 4096
platform_params : virt_start=0xffff800000000000
xen_changeset : unavailable
xen_commandline : placeholder
cc_compiler : gcc version 4.6.1 (Ubuntu/Linaro 4.6.0-10ubuntu2)
cc_compile_by : zulcss
cc_compile_domain : ubuntu.com
cc_compile_date : Sat Jun 4 19:41:05 UTC 2011
xend_config_format : 4

Then install keymaps on the box with stock Xen 4.1
in expected by xen location /usr/share/qemu/keymaps

root@boris-P5Q-E:/usr/share/qemu-linaro/keymaps# ls
ar de en-us fi fr-be hr it lv nl pl ru th
common de-ch es fo fr-ca hu ja mk nl-be pt sl tr
da en-gb et fr fr-ch is lt modifiers no pt-br sv
root@boris-P5Q-E:/usr/share/qemu-linaro/keymaps# cd ../../
root@boris-P5Q-E:/usr/share# mkdir qemu
root@boris-P5Q-E:/usr/share# cd qemu

*************************************************
Create directory as required by Xen
*************************************************

root@boris-P5Q-E:/usr/share/qemu# mkdir keymaps
root@boris-P5Q-E:/usr/share/qemu# cd keymaps
root@boris-P5Q-E:/usr/share/qemu/keymaps# pwd
/usr/share/qemu/keymaps
root@boris-P5Q-E:/usr/share/qemu/keymaps# cp /usr/share/qemu-linaro/keymaps/* .


Created installation profile


name="VF15"
memory=2048
disk = ['phy:/dev/sda8,xvda,w' ]
vif = [ 'bridge=br0' ]
vfb = [ 'vnc=1,vncunused=1']
kernel = "/root/vms/f15/vmlinuz"
ramdisk = "/root/vms/f15/initrd.img"
vcpus=2
on_reboot = 'restart'
on_crash = 'restart'


Vmlinuz , initrd.img downloaded from images/pxeboot folder local Apache Mirror.Started install . It requires "Tab" and good sense of wich button is current now.Mouse is a live, but actually useless. One more notice F15 (vs F14 ) goes directly to Fedora's Repos on Net. It requires 2-8 MBit/sec stable internet connection ( ADSL) install to be done in reasonable time frame.


# xm create f15.install
# vncviewer localhost:0

































Created runtime profile :


name="VF15"
memory=2048
disk = ['phy:/dev/sda8,xvda,w' ]
vif = [ 'bridge=br0' ]
vfb = [ 'vnc=1,vncunused=1']
bootloader = "/usr/lib/xen-4.1/bin/pygrub"
on_reboot = 'restart'
on_crash = 'restart'


# xm create f15.pyrun
# vncviewer localhost:0












During runtime :-
# virsh dumpxml VF15 > VF15.xml
Then shutdown domain and removed uuid line from XML-profile
# virsh define VF15.xml








Sunday, July 10, 2011


Implementation spice on Ubuntu 11.10 KVM Server



All packages required are already in PPA "Spice-Gtk-0.6 on Ubuntu 11.04 and Ubuntu 11.10".Spice-gtk-0.6 has been done for Oneiric as two builds. First one with python and gobject-introspection enabled (GTK2). Second one --with-introspection and --with-gtk="3.0" (GTK3).This builds actually are the core builds in PPA, which bring RH's technologies to Ubuntu 11.10. Patched virt-manager and virtinst also support spicevmc channel.View :-
Spice-Gtk-0.6 on Ubuntu 11.04 and Ubuntu 11.10
The only one qemu-kvm package should be rebuilt (spice enabled) as soon as stable qemu-kvm 0.15 git tree will be branched.







Sunday, July 11, 2010


exeCooler's patch



diff -r a672af698bc3 tools/python/xen/util/blkif.py
--- a/tools/python/xen/util/blkif.py Fri Jul 09 12:35:58 2010 +0100
+++ b/tools/python/xen/util/blkif.py Sun Jul 11 12:13:34 2010 +0400
@@ -87,7 +87,10 @@
fn = "/dev/%s" %(fn,)

if typ in ("tap", "tap2"):
- (taptype, fn) = fn.split(":", 1)
+ if fn.count(":") == 1:
+ (taptype, fn) = fn.split(":", 1)
+ else:
+ (taptype, fn) = fn.split(":", 2)[1:3]
return (fn, taptype)

def blkdev_uname_to_file(uname):

diff -r a672af698bc3 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py Fri Jul 09 12:35:58 2010 +0100
+++ b/tools/python/xen/xend/XendDomainInfo.py Sun Jul 11 17:16:39 2010 +0400
@@ -3261,6 +3261,7 @@

taptype = blkdev_uname_to_taptype(disk)
mounted = devtype in ['tap', 'tap2'] and taptype != 'aio' and taptype != 'sync' and not os.stat(fn).st_rdev
+ mounted_vbd_uuid = 0
if mounted:
# This is a file, not a device. pygrub can cope with a
# file if it's raw, but if it's QCOW or other such formats
@@ -3276,7 +3277,8 @@

from xen.xend import XendDomain
dom0 = XendDomain.instance().privilegedDomain()
- dom0._waitForDeviceUUID(dom0.create_vbd(vbd, disk))
+ mounted_vbd_uuid = dom0.create_vbd(vbd, disk);
+ dom0._waitForDeviceUUID(mounted_vbd_uuid)
fn = BOOTLOADER_LOOPBACK_DEVICE

try:
@@ -3286,8 +3288,9 @@
if mounted:
log.info("Unmounting %s from %s." %
(fn, BOOTLOADER_LOOPBACK_DEVICE))
-
- dom0.destroyDevice('tap', BOOTLOADER_LOOPBACK_DEVICE)
+ _, vbd_info = dom0.info['devices'][mounted_vbd_uuid]
+ dom0.destroyDevice(dom0.getBlockDeviceClass(vbd_info['devid']),
+ BOOTLOADER_LOOPBACK_DEVICE, force = True)

if blcfg is None:
msg = "Had a bootloader specified, but can't find disk"

Tuesday, May 18, 2010


Set up Libvirt 0.7.7&Xen 4.0 on top Fedora 13 RC2


Install Xen 4.0 and Libvirt exactly as in [1].
Via my experience xend will hang for 5-7 min at startup and xen managed bridging will fail as well as at the same time PV guests won't be able to obtain IP via interface virbr0. Workaround for the issue follow bellow. Comment out all xen bridging in /etc/xen/xend-config.sxp

Disable NetworkManager per [2]

# chkconfig NetworkManager off
# chkconfig network on
# service network start
# reboot

Creating network initscripts

In the /etc/sysconfig/network-scripts directory it is neccessary
to create 2 config files. The first (ifcfg-eth0) defines your physical
network interface, and says that it will be part of a bridge:

# cat > ifcfg-eth0 <<EOF
DEVICE=eth0
HWADDR=00:16:76:D6:C9:45
ONBOOT=yes
BRIDGE=br0
NM_CONTROLLED=no
EOF

Obviously change the HWADDR to match your actual NIC's address.


The second config file (ifcfg-br0) defines the bridge device:

# cat > ifcfg-br0 <<EOF
DEVICE=br0
TYPE=Bridge
BOOTPROTO=dhcp
ONBOOT=yes
DELAY=0
NM_CONTROLLED=no
EOF

Reboot
Now brctl should report :-
[root@FedoraSRV ~]# brctl show

bridge name bridge id STP enabled interfaces
br0 8000.00221563f99f no eth0
virbr0 8000.000000000000 yes

Run virt-install:-

virt-install -n VM13 -r 1024 -p --nographics -f /dev/sdc5 -l http://192.168.1.41/f13 --debug

Set up VNC connection to DomU at runtime. When done login to virsh console to set initdefault to 5 in /etc/inittab and create non-root user. Redefine DomU via XML profile :-

<domain type='xen'>
<name>FedoraPV</name>
<memory>2097152</memory>
<currentMemory>2097152</currentMemory>
<vcpu>1</vcpu>
<bootloader>/usr/bin/pygrub</bootloader>
<bootloader_args>-q</bootloader_args>
<os>
<type>linux</type>
</os>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
<disk type='block' device='disk'>
<driver name='phy'/>
<source dev='/dev/sdc5'/>
<target dev='xvda' bus='xen'/>
</disk>
<interface type='bridge'>
<mac address='00:16:3e:76:2b:53'/>
<source bridge='br0'/>
<script path='/etc/xen/scripts/vif-bridge'/>
<target dev='vif7.0'/>
</interface>
<console type='pty' tty='/dev/pts/1'>
<source path='/dev/pts/1'/>
<target port='0'/>
</console>
<input type='mouse' bus='xen'/>
<graphics type='vnc' port='5900' autoport='yes'/>
</devices>
</domain>







References
1.http://bderzhavets.wordpress.com/2010/04/14/zfs-24-support-via-pygrub-fsimage-iso-patch-for-xen-4-0-dom0-pvops-2-6-32-11-on-top-of-f12/
2.http://wiki.libvirt.org/page/Networking

Saturday, April 24, 2010

Set up Ubuntu 10.04 Server PV DomU at Xen 4.0 Dom0 (pvops 2.6.32.10 kernel) Dom0 on top of Ubuntu 10.04 Server

The procedure bellow in general follows Thiago's Martins submission to xen-devel mailing list.However,sequence of steps has been changed, git checkout procedure is more straight
forward and one Change-set from xen-4.0-testing.hg back ported to Xen 4.0 to support grub2 notation '(hd0,1)' specific for Ubuntu 10.04 aka Lucid Lynx. The way it worked on Ubuntu 9.10 (04) Servers doesn't work any longer


apt-get install libcurl4-openssl-dev \
xserver-xorg-dev \
mercurial gitk \
build-essential \
libncurses5-dev \
uuid-dev gawk \
gettext texinfo bcc \
libncurses5-dev dpkg-dev debhelper \
iasl texinfo


apt-get build-dep xen-3.3

Now git clone and checkout branch xen/stable

cd /usr/src
git clone
git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.git linux-2.6-xen
cd linux-2.6-xen
git checkout -b xen/stable origin/xen/stable

Build kernel in Debian way

make menuconfig # Enabled the dom0 support and the Xen backend as usual on Ubuntu 9.10, F12
make -j2
chmod g-s /usr/src -R
make deb-pkg
dpkg -i ../linux-image*2.6.32.10*.deb
depmod 2.6.32.10
update-initramfs -c -k 2.6.32.10
update-grub
echo "xen-evtchn" >> /etc/modules

At this point kernel is installed


Set up Xen 4.0 Hypervisor
cd /usr/src
Creare grub2-fix.patch1
as raw content of http://xenbits.xensource.com/xen-4.0-testing.hg?rev/065efaec5e71
Changeset 21112 pygrub: Fix Grub2 support for Ubuntu 10.04

gunzip xen-4.0.0.tar.gz
tar -xvf xen-4.0.0.tar
cd xen-4.0.0
patch -p1 -s -i ../grub2-fix.patch1
make xen
make tools
make install-xen
make install-tools PYTHON_PREFIX_ARG=


Set up xend,xendomains to run as services

update-rc.d xend defaults 20 21
update-rc.d xendomains defaults 21 20

Test Xen installation via creation Ubuntu 10.04 Server PV DomU
Create HVM DomU via profile

kernel="/usr/lib/xen/boot/hvmloader"
builder="hvm"
memory=2048
name="LucidSRV"
vcpus=1
vif = [ 'type=ioemu,bridge=eth0' ]
disk = [ 'phy:/dev/sdc5,hda,w']
device_model = "/usr/lib64/xen/bin/qemu-dm"
boot="d"
vnc=1

Due to CS 21112 PV DomU based on the same image may be loaded via profile

name="LucidPVG"
memory=2048
vcpus=1
bootloader="/usr/local/bin/pygrub"
disk=['phy:/dev/sdc5,xvda,w']
vif= ['bridge=eth0']
vfb=['type=vnc,vncunused=1']