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

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