qemu-toolkit / doc / qemu-toolkit-install.7

.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "QEMU\-TOOLKIT\-INSTALL" "7" "March 2013" "" "qemu-toolkit"
.
.SH "NAME"
\fBqemu\-toolkit\-install\fR \- installations instructions for the qemu\-toolkit
.
.SH "PREREQUISITES"
For this to run, you need at least one physical host running OmniOS \fIhttp://omnios\.omniti\.com/\fR or another Illumos \fIhttps://en\.wikipedia\.org/wiki/Illumos\fR\-based distro\. The host needs to support VT/x extensions to be able to run KVM\-based virtualisation\. Also, some basic working knowledge of Illumos is of help\.
.
.SH "INSTALLATION"
These instructions assume that you install on a clean OmniOS machine\. If you use another distribution, your mileage may vary\. If you have first\-hand experience on other distributions of Illumos, we\'d be interested to hear from you!
.
.SS "RVM & Ruby"
Install packages needed to build Ruby:
.
.IP "" 4
.
.nf

pkg install git autoconf gnu\-m4 gnu\-make gcc\-3 gnu\-patch \e
lint system/header header\-math gnu\-coreutils readline \e
gnu\-binutils gnu\-tar developer/linker
.
.fi
.
.IP "" 0
.
.P
Then make sure that you have \fB/usr/sfw/bin\fR in your PATH and that your linker is functional\.
.
.P
Install YAML:
.
.IP "" 4
.
.nf

wget http://pyyaml\.org/download/libyaml/yaml\-0\.1\.4\.tar\.gz
tar xzvf yaml\-0\.1\.4\.tar\.gz
cd yaml\-0\.1\.4
\./configure \-\-prefix=/usr
make
make install
.
.fi
.
.IP "" 0
.
.P
Then Ruby (via RVM):
.
.IP "" 4
.
.nf

curl \-L https://get\.rvm\.io | bash \-s stable \-\-ruby
.
.fi
.
.IP "" 0
.
.P
Please see the RVM website \fIhttps://rvm\.io/\fR for more information\.
.
.SS "\'socat\'"
socat is a tool that connects different types of sockets together\. The qemu\-toolkit toolchain uses it to make VNC and VM monitor available\.
.
.IP "" 4
.
.nf

wget \-\-no\-check\-certificate http://bit\.ly/TwNMrJ \-O socat\-1\.7\.1\.3\.tar\.gz
tar xzvf socat\-1\.7\.1\.3\.tar\.gz
cd socat\-1\.7\.1\.3
# PATCH for this to work: cat patch\.txt | patch
\./configure
make
make install
.
.fi
.
.IP "" 0
.
.P
Note that the above installation only succeeds if you patch socat using this patch:
.
.IP "" 4
.
.nf

\-\-\- sysincludes\.h\.orig  2012\-09\-03 16:59:09\.351904279 +0000
+++ sysincludes\.h       2012\-09\-03 16:59:54\.388720160 +0000
@@ \-131,6 +131,8 @@
 #include <netpacket/packet\.h>
 #endif
 #if HAVE_NETINET_IF_ETHER_H
+#include <net/if\.h>
+#include <netinet/in\.h>
 #include <netinet/if_ether\.h>
 #endif
 #if HAVE_LINUX_IF_TUN_H
.
.fi
.
.IP "" 0
.
.SS "iSCSI target"
If you want to use the machine as iSCSI target (as a storage provider), you\'ll need to do at least this:
.
.IP "" 4
.
.nf

pkg install network/iscsi/target
svcadm enable \-r svc:/network/iscsi/target:default
.
.fi
.
.IP "" 0
.
.P
The tools expect a target portal group named \fBfrontend\fR\. To create it, use something like the following command, where \fIIP\fR must be an TCP/IP address of the host you\'re doing this for:
.
.IP "" 4
.
.nf

itadm create\-tpg frontend IP
.
.fi
.
.IP "" 0
.
.SS "QEMU / KVM"
For qemu to work properly, you must make sure that you have at least as much swap space as you have RAM\. Default configuration only gives you 4GB of swap\. To fix this, do something like the following: (assumes that you\'ve got 30GB of RAM)
.
.IP "" 4
.
.nf

zfs set volsize=30G rpool/swap
.
.fi
.
.IP "" 0
.
.P
Also, perhaps obviously, you will need to load the kvm kernel driver\. This is accomplished by
.
.IP "" 4
.
.nf

add_drv kvm
.
.fi
.
.IP "" 0
.
.P
You will want to reboot the machine after these two steps for two reasons: Sometimes loading \fBkvm\fR interferes with reboot behaviour, you\'ll want to know that before you continue\. And swap resizing takes effect on reboot only\.
.
.SS "qemu\-toolkit"
Once you\'ve done all this, you\'re ready to install \fBqemu\-toolkit\fR\. Simply:
.
.IP "" 4
.
.nf

gem install qemu\-toolkit
.
.fi
.
.IP "" 0
.
.P
You should now have \fBvmadm\fR and \fBstoradm\fR in your path\.
.
.SH "FIRST STEPS"
Create a block device for your virtual machine\. Assuming you want to create it on \fIPOOL\fR:
.
.IP "" 4
.
.nf

storadm create POOL/myvm 10G
.
.fi
.
.IP "" 0
.
.P
This should create a dataset called \fIPOOL\fR\fB/myvm\fR and a subordinate zvol called \'disk1\'\. Let\'s connect a virtual machine to that disk:
.
.IP "" 4
.
.nf

vmadm create myvm
.
.fi
.
.IP "" 0
.
.P
This will create a configuration file called \fB/etc/qemu\-toolkit/myvm\.rb\fR\. Feel free to edit this\. Once you\'ve customized it to your liking, start the virtual machine and boot from an \fIISO\fR image:
.
.IP "" 4
.
.nf

vmadm start myvm \-\-bootiso=ISO
.
.fi
.
.IP "" 0
.
.P
If you\'re interested in configuring your virtual machine (qemu), please see qemu\-toolkit\-configuration(7)\.
.
.SH "SEE ALSO"
qemu\-toolkit\-overview(7), qemu\-toolkit\-install(7), qemu\-toolkit\-configuration(7), storadm(1), vmadm(1), README(7)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.