KVM: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 89: | Line 89: | ||
== | == Add user to the necessary groups == | ||
{{Root|# usermod -a -G kvm,qemu username}} | {{Root|# usermod -a -G kvm,qemu username}} | ||
== Usage == | |||
=== Generate random MAC adresses === | |||
{{Command|# echo -n DE:AD:BE:EF ; for i in `seq 1 2` ; do echo -n `echo ":$RANDOM$RANDOM" | cut -n -c -3` ;done}} | |||
Your can always setup new machines in your home directory, but here we assume we have a separate mount-point/partition which we mount at /mnt/kvm. | |||
{{Command|# mkdir -p /mnt/kvm}} | |||
{{Box File|/etc/conf.d/vde| | |||
<pre> | |||
/dev/sda4 /mnt/kvm ext4 defaults,auto,user 0 1 | |||
</pre> | |||
}} | |||
{{Root|# chown -R root:kvm /mnt/kvm}} | |||
{{Root|# chmod -R g+w /mnt/kvm}} | |||
{{Command|# kvm-img create -f qcow2 /mnt/kvm/linux-test.img 15G}} | |||
Revision as of 14:27, 9 July 2009
Description
Setting up the Kernel-based Virtual Machine including network configuration and beeing able to create and run new machines as a normal user without requiring root privileges.
Packages
USE-Flags
Installation
# # emerge kvm
Kernel Configuration
Network configuration
# # /etc/init.d/
# # ln -s net.lo net.br0
# # ln -s net.lo net.tap0
# # rc-update add net.br0 default
# # rc-update add net.tap0 default
# # rc-update add vde default
Add user to the necessary groups
# # usermod -a -G kvm,qemu username
Usage
Generate random MAC adresses
$ # echo -n DE:AD:BE:EF ; for i in `seq 1 2` ; do echo -n `echo ":$RANDOM$RANDOM"
Your can always setup new machines in your home directory, but here we assume we have a separate mount-point/partition which we mount at /mnt/kvm.
$ # mkdir -p /mnt/kvm
# # chown -R root:kvm /mnt/kvm
# # chmod -R g+w /mnt/kvm
$ # kvm-img create -f qcow2 /mnt/kvm/linux-test.img 15G