KVM - Linux kernel virtualization manager
Links: docker containers, Linux/Bridge
- Similar in function to VMware, it uses linux as a hypervisor for guest virtual machines.
- Makes use of hardware virtualization built into most CPU's.
- Gui - Virtual Machine Manager
Memory dedup with KSM
- Monitor ksm with
watch -d "tail /sys/kernel/mm/ksm/* | sed -e :a -e 's/\(.*[0-9]\)\([0-9]\{3\}\)/\1,\2/;ta'"
- Monitor ksm with
Storage virsh/kvm
- Disk storage is a pool, volumes is created from the pool and assigned to individual VM's.
virsh vol-list default
Ubuntu cloud images on KVM
- Need a config iso to configure user and ssh keys on boot
sudo apt install cloud-image-utils
- Setup config file, must start with #cloud-config, file name: ubuntu-cloudimg-seed.txt
#cloud-config output: {all: '| tee -a /var/log/cloud-init-output.log'} password: ubuntu chpasswd: { expire: False } ssh_pwauth: True ssh_authorized_keys: - ssh-rsa AAAAxxxxxxxxxxxxx # Add users to the system. Users are added after groups are added. # - default = the 'ubuntu' user in addition to other users users: - default - name: vagrant passwd: $6$vxxxxx<hash generated see comment below>xxxxxx ### python3 -c 'import crypt,getpass; print(crypt.crypt(getpass.getpass(), crypt.mksalt(crypt.METHOD_SHA512)))' lock-passwd: False chpasswd: { expire: False } gecos: Default dev username vagrant primary-group: vagrant groups: sudo #selinux-user: staff_u #expiredate: 2012-09-01 #ssh-import-id: vagrant ssh_pwauth: True write_files: - path: /test-pes-create.txt content: | Here is a line. Another line is here. runcmd: - touch /test-pes.txt
- now use cloud-localds to create a iso/cdrom file to boot the ubuntu-cloud image with, the iso contains the config
cloud-localds -vv ~/seed00.img ubuntu-cloudimg-seed.txt
VBox - Oracle virtual box
- Create physical disk drive
\Program Files\Oracle\VirtualBox\VBoxManage.exe" internalcommands createrawvmdk -filename "C:\Users\<user_name>\VirtualBox VMs\<VM_folder_name>\<file_name>.vmdk" -rawdisk \\.\PhysicalDrive#
...