/doc/qemu-toolkit-install.7.ronn
Unknown | 136 lines | 93 code | 43 blank | 0 comment | 0 complexity | c3609cbfe57aff425c995cfcfd9e1174 MD5 | raw file
1# qemu-toolkit-install(7) -- installations instructions for the qemu-toolkit
2
3## PREREQUISITES
4
5For this to run, you need at least one physical host running
6[OmniOS](http://omnios.omniti.com/) or another
7[Illumos](https://en.wikipedia.org/wiki/Illumos)-based distro. The host needs
8to support VT/x extensions to be able to run KVM-based virtualisation. Also,
9some basic working knowledge of Illumos is of help.
10
11## INSTALLATION
12
13These instructions assume that you install on a clean OmniOS machine. If you
14use another distribution, your mileage may vary. If you have first-hand
15experience on other distributions of Illumos, we'd be interested to hear from
16you!
17
18### RVM & Ruby
19
20Install packages needed to build Ruby:
21
22 pkg install git autoconf gnu-m4 gnu-make gcc-3 gnu-patch \
23 lint system/header header-math gnu-coreutils readline \
24 gnu-binutils gnu-tar developer/linker
25
26Then make sure that you have `/usr/sfw/bin` in your PATH and that your
27linker is functional.
28
29Install YAML:
30
31 wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
32 tar xzvf yaml-0.1.4.tar.gz
33 cd yaml-0.1.4
34 ./configure --prefix=/usr
35 make
36 make install
37
38Then Ruby (via RVM):
39
40 curl -L https://get.rvm.io | bash -s stable --ruby
41
42Please see the RVM [website](https://rvm.io/) for more information.
43
44### 'socat'
45
46socat is a tool that connects different types of sockets together. The
47qemu-toolkit toolchain uses it to make VNC and VM monitor available.
48
49 wget --no-check-certificate http://bit.ly/TwNMrJ -O socat-1.7.1.3.tar.gz
50 tar xzvf socat-1.7.1.3.tar.gz
51 cd socat-1.7.1.3
52 # PATCH for this to work: cat patch.txt | patch
53 ./configure
54 make
55 make install
56
57Note that the above installation only succeeds if you patch socat using this
58patch:
59
60 --- sysincludes.h.orig 2012-09-03 16:59:09.351904279 +0000
61 +++ sysincludes.h 2012-09-03 16:59:54.388720160 +0000
62 @@ -131,6 +131,8 @@
63 #include <netpacket/packet.h>
64 #endif
65 #if HAVE_NETINET_IF_ETHER_H
66 +#include <net/if.h>
67 +#include <netinet/in.h>
68 #include <netinet/if_ether.h>
69 #endif
70 #if HAVE_LINUX_IF_TUN_H
71
72### iSCSI target
73
74If you want to use the machine as iSCSI target (as a storage provider), you'll
75need to do at least this:
76
77 pkg install network/iscsi/target
78 svcadm enable -r svc:/network/iscsi/target:default
79
80The tools expect a target portal group named `frontend`. To create it, use
81something like the following command, where <IP> must be an TCP/IP address
82of the host you're doing this for:
83
84 itadm create-tpg frontend IP
85
86### QEMU / KVM
87
88For qemu to work properly, you must make sure that you have at least as much
89swap space as you have RAM. Default configuration only gives you 4GB of swap.
90To fix this, do something like the following: (assumes that you've got 30GB of
91RAM)
92
93 zfs set volsize=30G rpool/swap
94
95Also, perhaps obviously, you will need to load the kvm kernel driver. This is
96accomplished by
97
98 add_drv kvm
99
100You will want to reboot the machine after these two steps for two reasons:
101Sometimes loading `kvm` interferes with reboot behaviour, you'll want to know
102that before you continue. And swap resizing takes effect on reboot only.
103
104### qemu-toolkit
105
106Once you've done all this, you're ready to install `qemu-toolkit`. Simply:
107
108 gem install qemu-toolkit
109
110You should now have `vmadm` and `storadm` in your path.
111
112## FIRST STEPS
113
114Create a block device for your virtual machine. Assuming you want to create
115it on <POOL>:
116
117 storadm create POOL/myvm 10G
118
119This should create a dataset called <POOL>`/myvm` and a subordinate zvol
120called 'disk1'. Let's connect a virtual machine to that disk:
121
122 vmadm create myvm
123
124This will create a configuration file called `/etc/qemu-toolkit/myvm.rb`.
125Feel free to edit this. Once you've customized it to your liking, start the
126virtual machine and boot from an <ISO> image:
127
128 vmadm start myvm --bootiso=ISO
129
130If you're interested in configuring your virtual machine (qemu), please see
131qemu-toolkit-configuration(7).
132
133## SEE ALSO
134
135qemu-toolkit-overview(7), qemu-toolkit-install(7),
136qemu-toolkit-configuration(7), storadm(1), vmadm(1), README(7)