Showing posts with label virtualization. Show all posts
Showing posts with label virtualization. Show all posts

17 April 2021

Enable nested virtualization on ESXi

 For ESXi 5.1

Kaedah 1:




Kaedah 2: 
  1. Cleanly shutdown your VIRL virtual machine
  2. Open the .vmx file with a text editor like Notepad++ or Text Wrangler
  3. Ensure this line is present and value set to TRUE
    • vhv.enable = "TRUE"


ref: https://learningnetwork.cisco.com/s/article/t-shoot-kvm-ok-your-cpu-does-not-support-kvm-extensions

25 August 2020

Good read to understand relation of Virtualization - Hypervisor - KVM -QEMU


- KVM is linux kernel modul. No gui. Only provide CPU and RAM, not hd, network etc.

- Qemu is an emulator of varied cpu. It also has features to use KVM which will boost performance compare to other emulated cpu type.

-Libvirt as wrapper to start QEMU with the right options.


For more, refer this good explanation:

 https://superuser.com/questions/1490188/what-is-the-difference-and-relationship-between-kvm-virt-manager-qemu-and-libv

24 August 2020

Proxmox Nested Virtualization

 How to install qemu in a proxmox guest.

(Baremetal has proxmox, guest will has qemu(to install another guest on top of qemu)

Qemu/KVM is a hypervisor, same also as proxmox.


1) Enable Nested virtualization on proxmox

a)- check is nested enabled:

cat /sys/module/kvm_intel/parameters/nested
Y  - yes
N - not enabled


b)- if not enable, 
# echo "options kvm-intel nested=Y" > /etc/modprobe.d/kvm-intel.conf

c)- then reboot and reload
modprobe -r kvm_intel
modprobe kvm_intel

then check again if nested succesfully enable (a)




2)- Create a guest(of proxmox) with 'CPU Type': host

a) to verify guest support hardware virtualization:
egrep '(vmx|svm)' --color=always /proc/cpuinfo






ref:  https://pve.proxmox.com/wiki/Nested_Virtualization



KVM Qemu virsh

-list storage(pool)

 virsh pool-list


-list volume

virsh vol-list __poolName__



-list vm

# virsh list --all






ref:   https://docs.deistercloud.com/content/Tutorials.100/Linux.80/KVM%20virtualization.40/KVM%20VirSH%20Command.xml?embedded=true


good one: https://serverfault.com/questions/434064/correct-way-to-move-kvm-vm/434070#434070

23 October 2019

Convert virtual disk to RAW disk image

1- Format VBox
vboxmanage clonemedium  ./disk.raw --format=raw

Now disk.raw can be read by mmls to get partition offset.
mmls disk.raw



2- VMDK

If your mmls support afflib, you can directly process it.
mmls -i afflib vmDisk.vmdk


If yours does not support afflib, you need to convert to raw format using qemu-img
qemu-img convert -f vmdk -O raw vmImage/vm_disk.vmdk vm_disk.raw

Now disk.raw can be read by mmls to get partition offset.
mmls disk.raw



Snapshot:
Lets say the image has 2 snapshot of disk vm_disk.vmdk
File *.vmsd will track this snapshot(mapping snapshot name to the vmdk file). Lets say vmImage.vmsd is as as follow:
.encoding = "UTF-8"
snapshot.lastUID = "2"
snapshot.current = "2"
snapshot0.uid = "1"
snapshot0.filename = "vmImage-Snapshot1.vmsn"
snapshot0.displayName = "asal"
snapshot0.createTimeHigh = "365944"
snapshot0.createTimeLow = "26982807"
snapshot0.numDisks = "1"
snapshot0.disk0.fileName = "vm_disk.vmdk"
snapshot0.disk0.node = "scsi0:0"
snapshot.numSnapshots = "2"
snapshot.mru0.uid = "2"
snapshot1.uid = "2"
snapshot1.filename = "vmImage-Snapshot2.vmsn"
snapshot1.parent = "1"
snapshot1.displayName = "kedua"
snapshot1.createTimeHigh = "365947"
snapshot1.createTimeLow = "170475548"
snapshot1.numDisks = "1"
snapshot1.disk0.fileName = "vm_disk-000001.vmdk"
snapshot1.disk0.node = "scsi0:0"
snapshot.mru1.uid = "1"
This file show the image has 2 snapshot, 'asal' and 'kedua'. 
Snapshot 'asal' point the disk to vm_disk.vmdk. 

Snapshot 'kedua' point the disk to vm_disk-000001.vmdk.

Current state of disk is set in the vmImage.vmx file:
scsi0:0.fileName = "vm_disk-000002.vmdk"

To convert the snapshot disk to raw disk, just pass the any of snapshotXX.diskXX.fileName value(eg: vm_disk-000001.vmdk) to the qemu-img convert as pointed previously.
qemu-img convert -f vmdk -O raw vm_disk-000001.vmdk /tmp/snap_kedua.raw

04 April 2012

clone VritualBox


  1. Buka 'Virtual Media Manager'
  2. Klik file vdi(hardisk image) dan klik 'Release'
    • Kalau tak buat ni nanti dpt Error: already exists in the media registry
  3. taip:
    • vboxmanage clonehd asal.vdi baruClone.vdi
  4. Add to virtual box manager

05 August 2011

workstation 6.5.5 tak boleh compile atas kernel 2.6.38 (natty)


1) 

cd /usr/lib/vmware/modules/source
tar xf file berikut(vmci.tar, vmmon.tar, vmnet.tar, vsock.tar)
buat backup semua file .tar di atas.


2)
applykan patch berikut: http://communities.vmware.com/servlet/JiveServlet/download/1721070-60934/2.6.37.1-1.2_6.5.5.patch
compress balik kod yg dah dipatch dalam .tar masing-masing.


3)
run: vmware-modconfig --console --install-all




ref: 
http://communities.vmware.com/message/1721070#1721070