KvmOnGentoo: Difference between revisions

From KVM
No edit summary
No edit summary
 
(7 intermediate revisions by 3 users not shown)
Line 14: Line 14:


== Installing ==
== Installing ==
* printf 'QEMU_SOFTMMU_TARGETS="i386 x86_64"\nQEMU_USER_TARGETS="i386 x86_64"\n' >> /etc/make.conf
* printf '%s\n' 'QEMU_SOFTMMU_TARGETS="i386 x86_64"' 'QEMU_USER_TARGETS="i386 x86_64"' >> /etc/portage/make.conf
* echo "app-emulation/qemu-kvm ~amd64" >> /etc/portage/package.keywords
(If you haven't migrated /etc/make.conf to /etc/portage/make.conf yet, use /etc/make.conf instead or migrate it to /etc/portage/make.conf)
* emerge app-emulation/qemu-kvm
* emerge app-emulation/qemu-kvm


Line 21: Line 21:
=== Bridged ===
=== Bridged ===
* edit /etc/conf.d/net
* edit /etc/conf.d/net
       config_eth0=( "null" ) # any any other interfaces you want to bridge
       config_eth0="null" # any any other interfaces you want to bridge
       bridge_brkvm="eth0"
       bridge_brkvm="eth0"
       config_brkvm=( "192.168.254.254/24" ) # the ip of the original eth0, or dhcp
       config_brkvm="192.168.254.254/24" # the ip of the original eth0, or dhcp
       brctl_brkvm=(
       brctl_brkvm="setfd 0
        "setfd 0"
        sethello 30
        "sethello 30"
        stp off"
        "stp off"
 
      )
* cd /etc/init.d
* cd /etc/init.d
* ln -s net.lo net.brkvm
* ln -s net.lo net.brkvm
* rc-update add net.brkvm default
* rc-update add net.brkvm default
* rc-update del net.eth0 default
* rc-update del net.eth0 default
== VM start/stop ==
* there are no standard Gentoo way to do this, you will need 3rd party scripts/front-ends.
== Spice ==
(TODO)

Latest revision as of 07:34, 9 May 2013

Requirement

  • a Gentoo install on a vt (Intel) or svm (AMD) machine
  • kernel compiled with at least, either y or m
     CONFIG_HAVE_KVM=y
     CONFIG_HAVE_KVM_IRQCHIP=y
     CONFIG_HAVE_KVM_EVENTFD=y
     CONFIG_KVM=y
     and CONFIG_KVM_INTEL=y or CONFIG_KVM_AMD=y depending if you are using Intel or AMD CPU
     
     optionally (if you want to use vhost)
     CONFIG_VHOST_NET=y

Installing

  • printf '%s\n' 'QEMU_SOFTMMU_TARGETS="i386 x86_64"' 'QEMU_USER_TARGETS="i386 x86_64"' >> /etc/portage/make.conf

(If you haven't migrated /etc/make.conf to /etc/portage/make.conf yet, use /etc/make.conf instead or migrate it to /etc/portage/make.conf)

  • emerge app-emulation/qemu-kvm

Network setup

Bridged

  • edit /etc/conf.d/net
     config_eth0="null" # any any other interfaces you want to bridge
     bridge_brkvm="eth0"
     config_brkvm="192.168.254.254/24"  # the ip of the original eth0, or dhcp
     brctl_brkvm="setfd 0
        sethello 30
        stp off"
  • cd /etc/init.d
  • ln -s net.lo net.brkvm
  • rc-update add net.brkvm default
  • rc-update del net.eth0 default

VM start/stop

  • there are no standard Gentoo way to do this, you will need 3rd party scripts/front-ends.

Spice

(TODO)