42c6cedcc40c304a033fdf54ec1643d7ce19c160
[supernested.git] / README
1 Supernested is a test of nested KVM.  It is able to run KVM, nested to
2 any depth, limited only by available memory, bugs in KVM, and your
3 patience.
4
5
6 Author
7 ----------------------------------------------------------------------
8
9 By Richard W.M. Jones <rjones@redhat.com>
10
11 Bugs, feedback etc: http://www.redhat.com/mailman/listinfo/virt-tools-list
12
13 (Note: Bugs in KVM or the kernel should be reported to the qemu-devel
14 or Linux kernel mailing lists respectively)
15
16
17 License
18 ----------------------------------------------------------------------
19
20 Gnu General Public License, version 2 or above.  See 'COPYING'.
21
22
23 Requirements
24 ----------------------------------------------------------------------
25
26  - Have a look at the 'build-supernested.sh.in' script for a variable
27    called $packages.  You need to install all of those packages on the
28    host.
29
30  - supermin version 5
31    https://github.com/libguestfs/supermin
32    Note: older versions of supermin will not work
33
34  - guestfish
35
36  - recent qemu and kernel
37
38  - qemu-img
39
40  - getopt(1) utility (from util-linux)
41
42  - Only tested on Fedora, but it should work on other Linux distros
43    *provided* they have supermin 5 support.  Patches to fix that are
44    welcome.
45
46
47 Compiling the disk image
48 ----------------------------------------------------------------------
49
50 To build the disk image, do:
51
52   autoreconf -i
53   ./configure
54   make
55
56 If supermin and qemu are not in the normal location on the path, you
57 can set SUPERMIN and QEMU environment variables before running
58 ./configure.
59
60 Assuming that works you will end up with 4 files:
61
62  - 'supernested-<VERSION>-<DISTRO>.qcow2'
63    The disk image.
64
65  - 'kernel'
66
67  - 'initrd'
68
69  - 'run-supernested.sh'
70
71 You need all 4 files for the next step.
72
73
74 Running the disk image
75 ----------------------------------------------------------------------
76
77 !NOTE FIRST!  If nested KVM is broken, it can *frequently* cause your
78 host machine to crash, reboot, catch fire, etc.  You need to run this
79 on baremetal, on a machine which is KVM-capable, a modern CPU, with
80 lots of free memory, and nothing much else running.
81
82 You need to have the kernel KVM module (eg. kvm_amd or kvm_intel)
83 loaded, with the nested=1 flag.  The nested flag defaults to true for
84 AMD in recent kernels, but not for Intel.  To force this, do:
85
86   mkdir -p /etc/modprobe.d
87   echo "options kvm_intel nested=1" > /etc/modprobe.d/kvm.conf
88
89 To see if nested is enabled, use:
90
91   cat /sys/modules/kvm_(intel|amd)/parameters/nested
92
93 /dev/kvm needs to be accessible.  On some distros you may need to add
94 your user to a special 'kvm' group.
95
96 You *don't* need to run this command as root.  Running it as root may
97 give different results.  Consult a qemu/KVM expert.
98
99 Have a look at the 'run-supernested.sh' script.  You may want to edit
100 things like the name of the qemu binary.
101
102   ./run-supernested.sh