Difference between revisions of "Instalasi KVM"

From OnnoWiki
Jump to navigation Jump to search
Line 33: Line 33:
 
  # atau: sudo /sbin/modprobe kvm-amd
 
  # atau: sudo /sbin/modprobe kvm-amd
  
Jika kita menggunakan kernel yang tua, atau kernel dari If you're using an older kernel, or a kernel from your distribution without the kvm modules, you'll have to compile the modules yourself:
+
Jika kita menggunakan kernel yang tua, atau kernel dari distribusi tanpa modul KVM, kita harus mengcompile module itu sendiri:
  
 
  tar xjf kvm-kmod-release.tar.bz2
 
  tar xjf kvm-kmod-release.tar.bz2
Line 43: Line 43:
 
  # atau: sudo /sbin/modprobe kvm-amd
 
  # atau: sudo /sbin/modprobe kvm-amd
  
Note: if sound doesn't play in the guest vm you can add --audio-drv-list="alsa oss" to ./configure as explained in http://www.linux-kvm.com/content/sound-problem-solved
+
Catatan: jika souned tidak jalan di VM guest, kita dapat menambahkan --audio-drv-list="alsa oss" ke ./configure seperti di jelaskan di http://www.linux-kvm.com/content/sound-problem-solved
  
 
==Membuat Disk Image untuk Guest==
 
==Membuat Disk Image untuk Guest==
Line 57: Line 57:
  
 
If you have less than 1GB of memory don't use the -m 384 flag (which allocates 384 MB of RAM for the guest). For computers with 512MB of RAM it's safe to use -m 192, or even -m 128 (the default)
 
If you have less than 1GB of memory don't use the -m 384 flag (which allocates 384 MB of RAM for the guest). For computers with 512MB of RAM it's safe to use -m 192, or even -m 128 (the default)
[edit]
 
Running the newly-installed guest
 
  
sudo /usr/local/kvm/bin/qemu-system-x86_64 vdisk.img -m 384
+
==Menjalankan guest yang baru di install==
 +
 
 +
sudo /usr/local/kvm/bin/qemu-system-x86_64 vdisk.img -m 384
  
 
or a slightly more complicated example, where it is assumed that bridged networking is available on tap0; see ["Kernel-optimizations"] for some setup hints:
 
or a slightly more complicated example, where it is assumed that bridged networking is available on tap0; see ["Kernel-optimizations"] for some setup hints:
  
/usr/local/kvm/bin/qemu-system-x86_64 -hda xp-curr.img -m 512 -soundhw es1370 -no-acpi -snapshot -localtime -boot c -usb -usbdevice tablet -net nic,vlan=0,macaddr=00:00:10:52:37:48 -net tap,vlan=0,ifname=tap0,script=no
+
/usr/local/kvm/bin/qemu-system-x86_64 -hda xp-curr.img -m 512 -soundhw es1370 -no-acpi -snapshot -localtime -boot c -usb -usbdevice tablet -net nic,vlan=0,macaddr=00:00:10:52:37:48 -net tap,vlan=0,ifname=tap0,script=no
  
 
(kvm doesn't make a distinction between i386 and x86_64 so even in i386 you should use `qemu-system-x86_64`)
 
(kvm doesn't make a distinction between i386 and x86_64 so even in i386 you should use `qemu-system-x86_64`)

Revision as of 10:22, 21 May 2012

Prasyarat

kita akan membutuhkan

  • qemu-kvm-release.tar.gz
  • kvm-kmod-release.tar.bz2 (jika kita membutuhkan untuk mengcompile module itu sendiri)
  • Intel processor yang punya VT, atau AMD processor dengan kemampuan SVM
  • qemu prerequisites:
o `zlib` libraries and headers
o `SDL` libraries and headers
o `alsa` libraries and headers (optional alsa support: disabled by default but can be enabled with --enable-alsa)
o `gnutls` libraries and headers (optional VNC TLS support: enabled by default but can be disabled with --disable-vnc-tls)
o kernel headers (on Fedora, the kernel-devel package) 

Di Debian etch atau Ubuntu 10.10

apt-get install gcc libsdl1.2-dev zlib1g-dev libasound2-dev linux-kernel-headers pkg-config libgnutls-dev libpci-dev

Jika membuat dari git, kita juga akan membutuhkan gawk

Membuka dan mengkonfigurasi komponen KVM

Lakukan

cp qemu-kvm-0.13.0.tar.gz /usr/local/src/
cd /usr/local/src/
tar zxvf qemu-kvm-0.13.0.tar.gz
cd /usr/local/src/qemu-kvm-0.13.0/
./configure --prefix=/usr/local/kvm
make
sudo make install
sudo /sbin/modprobe kvm-intel
# atau: sudo /sbin/modprobe kvm-amd

Jika kita menggunakan kernel yang tua, atau kernel dari distribusi tanpa modul KVM, kita harus mengcompile module itu sendiri:

tar xjf kvm-kmod-release.tar.bz2
cd kvm-kmod-release 
./configure
make 
sudo make install 
sudo /sbin/modprobe kvm-intel 
# atau: sudo /sbin/modprobe kvm-amd

Catatan: jika souned tidak jalan di VM guest, kita dapat menambahkan --audio-drv-list="alsa oss" ke ./configure seperti di jelaskan di http://www.linux-kvm.com/content/sound-problem-solved

Membuat Disk Image untuk Guest

/usr/local/kvm/bin/qemu-img create -f qcow2 vdisk.img 10G


Install Sistem Operasi Guest

sudo /usr/local/kvm/bin/qemu-system-x86_64 -hda vdisk.img -cdrom /path/to/boot-media.iso -boot d  -m 384

(kvm doesn't make a distinction between i386 and x86_64 so even in i386 you should use `qemu-system-x86_64`)BR

If you have less than 1GB of memory don't use the -m 384 flag (which allocates 384 MB of RAM for the guest). For computers with 512MB of RAM it's safe to use -m 192, or even -m 128 (the default)

Menjalankan guest yang baru di install

sudo /usr/local/kvm/bin/qemu-system-x86_64 vdisk.img -m 384

or a slightly more complicated example, where it is assumed that bridged networking is available on tap0; see ["Kernel-optimizations"] for some setup hints:

/usr/local/kvm/bin/qemu-system-x86_64 -hda xp-curr.img -m 512 -soundhw es1370 -no-acpi -snapshot -localtime -boot c -usb -usbdevice tablet -net nic,vlan=0,macaddr=00:00:10:52:37:48 -net tap,vlan=0,ifname=tap0,script=no

(kvm doesn't make a distinction between i386 and x86_64 so even in i386 you should use `qemu-system-x86_64`)

If you're on Debian Etch, substitute `kvm` for `qemu-system-x86_64` (thanks to fromport, soren and mael_). See also the entries under the label "Ubuntu" on the HOWTO page. qemu-system-x86_64`

If you're on Fedora/RHEL/CentOS (and installed a kvm package and not built kvm yourself from source) then substitute qemu-kvm for qemu-system-x86_64


Referensi

Pranala Menarik