Message-ID: <13375563.513.1711727174850.JavaMail.serveradmin@t01app> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_512_29184631.1711727174844" ------=_Part_512_29184631.1711727174844 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html Cloud Fondations - Hypervisor KVM at Home

Cloud Fondations - Hypervisor KVM at Home

Not ready for others to use.

=20 =20

Introduction

Google Cloud's Compute Engine uses KVM as the hypervisor= . Nuff said in terms of longevity, security and sup= port. The other advantage and reason I settled on KVM is that unlike other hypervi= sors it works with pretty much any hardware (which I found out the hard way= trying to get my old Dell laptop working with other options first).

What is outlined here can be considered foundational home Cloud to gain = an under the hoods look at Google Cloud engine.

Setup Server

Setup Ubuntu Server on Dell laptop (really don't use Dell because it has= various challenges... ).

I initially did this using seutpadmin (and noticed after that it somehow= got added to the group libvirtd)... which is required to manage libvirtd.<= /p>

This is a true server, so no GUI to keep down maintenance.

Install KVM using Ubuntu instructions. = Will manage using VirtManager= .

To get things going here simply... do not setup ssh key only authentication yet. Instead just enable key authentication, (keep lin= e x commented out) and you will have both password and key authentication w= orking.

Setup Accounts linked to libvirtd

It looks like by default the account used to install KVM gets added to t= he group libvirtd (to confirm this).

If you want an account to manage KVM, you must add the group libvirtd to= the account on the Hypervisor host. In this case, I would like my staff ac= count tin.pham for both local and later remove client administration of KVM= .

In keeping things simple, I do not start out with tin.pham enabled to us= e ssh key authentication.

Setup Client Manager on Separate Machine

Best to use Ubuntu default Desktop. I'm using the Ubuntu default desktop= in a VMWare Fusion on my iMac (link to this as separate article where the = Ubuntu desktop is also stripped down).

I like consistency, but you don't need to do same... I plan to manage wi= th tin.pham so I create the exact same user with same id. Note it looks lik= e the (period) in tin.pham causes a bug in the gui Desktop so I manually cr= eate the user and add the groups required,

=20
# to pu=
t instructions here... but basically create at terminal like normal, then l=
ook at the initial default setup user, in this case setupadmin and replicat=
e the groups
=20

Install Virtual Manager,

=20
sudo ap=
t-get install virt-manager
=20

Install passkey,

Install SSH Ask Pass Addon to Ubuntu Gnome Desktop= ,

=20
sudo ap=
t-get install ssh-askpass-gnome
=20

Ignore the extra virt-manager login during intial login.

Change some defaults,

Edit, Preferences, 

  • Polling - enable Poll Memory stats
  • New VM - Change graphics type to VNC ... as we are remote managing

Then View, Graph and enable Memory Usage.

Connect = for First Time

... instructions from screenshots to put up

... show and talk about error if user account being used does not have l= ibvirtd in groups.

Enab= le Key Authentication

... then delete and enable authentication

... tip having trouble make sure both passphrase and key work and use tw= o distinct accounts to test

Setup Folder and Upload iso files

Upload ISO images into /var/lib/libvirt/images ... I can customize by mo= difying gui to add storage pool but what exactly is the concept 3D"(question)"?.

/opt/kvm-data/iso-images/

Setup Vi= rtual Machine

There's a tricky thing here &= nbsp;"Spice server" to "VNC server" ... look up how to make "VNC serve= r" the default for VM creations.

VNC... Ensure you have good enough resolution... lookup how to refresh v= nc screen....

I setup using direct ISO loads.

Ubuntu Desktop=

Easy and one via iso load. Just link to slimming down.

Windows 7 64-bit Ultimate Edition

Windows unlike Linux requires virtio drivers to get features for the VM = to,

  • Release memory
  • Improve performance

Note though that I found with VirtIO Disk I lost the ability to take sna= pshots though with VirtIO Disk... I believe this is just a bug though and w= ill get fixed in the future (July 2017).

Looks promising - https://access.= redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualizati= on_Host_Configuration_and_Guest_Installation_Guide/form-Virtualization_Host= _Configuration_and_Guest_Installation_Guide-Para_virtualized_drivers-Instal= ling_with_a_virtualized_floppy_disk.html


...

Download and load the Virtio Floppy Disk (virtio-win amd64 floppy).

Start the Windows 7 setup as normal but you will be prompted the V= irtio Hard Disk drivers which you point to on the floppy.

Don't update Windows yet. Shutdown and load Windows 7 ISO (virtio-win = iso) from RedHat. B= oot up.

Going into device manager you will see something missing, it'= s the memory driver so load it.

Shutdown again you then need to set the min (current allocation) a= nd max (maximum allocation) to properly use the vritio memory driver). You = might want to watch your actual memory usage to determine best min because = ballooning likely (need to check) take resources and you also want to not s= et yourself up to be over allocated if other systems ballon too. For m= y needs Win 7 I find it usually stays at 1.6GB, so I allocate 1.6GB - 4GB.<= /span>

Finally, the default realtek network should work, but to get bette= r performance switch to the virtio network card and repeat.


Windows 10

Not supported officially yet. Windows 7 is more than fine given it won't= drop support for next few years. Unofficial here,

Finally Good more decent instructions - http://www.techotopia.com/index.php/C= reating_a_CentOS_6_KVM_Networked_Bridge_Interface

Instructions - http://bart= .vanhauwaert.org/hints/installing-win10-on-KVM.html

Ubuntu KVM Guest Drivers - http= s://launchpad.net/kvm-guest-drivers-windows/+download

Expose VMs to the Network via Public Bridge

Ubuntu Server

KVM can setup up a Public Bridge during boot of the VM and this can be m= anipulated using VMM (Virtual Machine Manager).

First confirm the name of your active network card.

(to put instructions here)

Using VMM. Turn off you VM if not already off. Load Information window, = choose NIC, change Network source to Host device macvtap. Notice KVM auto g= enerated a unique mac.

Boot and now your VM exists like a real machine on your existing network= ....

But this is not really a good solution and problematic as I foun= d with Ubuntu Desktop... leading to the real solution which is to use VMM a= t the higher level and configure a proper bridge.

Finally found the clarity by following instructions at techotopia.com. Note as= you follow the VMM GUI instructions you will find VMM will get disconnecte= d after it executes the changes. Just reconnect after the changes are done.=

Abridged notes...

  • Determine your existing network interface that works, in my case enp2s0= .
  • Make a new bridge interface we'll call br0
  • Make enp2s0 slave to br0
  • br0 then is your new primary interface, receiving the host's IP address= on your NIC
  • But it also is in bridge mode so VMs choosing to use br0 will get their= own IP address against the same network via dhcp

You end up with /etc/network/interfaces going from this,

... put original file here...

To this

... to pu here ...

Additionally if you want to use a static IP,

Go from this,

=20
# This =
file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto enp2s0
iface enp2s0 inet static
address 192.168.0.7
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 192.168.0.1
=20

And after using VMM to configure the bridge it should look like this,

=20
 This f=
ile describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto br0
iface br0 inet dhcp
   bridge_ports enp2s0
   bridge_stp on
   bridge_fd 0.0
=20

And then you need to manually edit to give br0 the static ip,

=20
# This =
file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto br0
iface br0 inet static
   address 192.168.0.7
   netmask 255.255.255.0
   gateway 192.168.0.1
   dns-nameservers 192.168.0.1
   bridge_ports enp2s0
   bridge_stp on
   bridge_fd 0.0
=20

If interested, you may want to read more details about bridge networking for vir= tualization.

...


Ubuntu Deskt= op

Did not work retrofitting... so this time trying during vm setup before = install,

Network selection, Host device macvtp, Bridge... hmmm what is Passthroug= h

...

Resource = Management

Understanding Dynamic Memory...

Windows zero's memory on boot so uses it all.

Some Linux (check Ubuntu and how LXD goes into this) is smart with ballo= on drivers which release memory back to host if not used.

References

Hypervisor view of managing resources - http://www.altaro.com/hyper-v/common-hyper-v-deployment-mi= stakes/

Q&A... Memory aspect was new to new to me - http://= www.linux-kvm.org/page/FAQ

Alternative Container Manager and similar to Virtual Machine Manager can= also be used for Linux Containers.

This article can help this person... when completed follow-up with a pos= t - https://askubuntu.com/question= s/28056/kvm-with-windows-xp


------=_Part_512_29184631.1711727174844 Content-Type: image/png Content-Transfer-Encoding: base64 Content-Location: file:///C:/4b31cc961523b025f30e4b4c37732dee iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAA3NCSVQICAjb4U/gAAAANlBMVEX/ //87c687c687c687c687c687c6/////z9/rn7vXP3Ou2y+GqwtyFqM14n8hgjb5HfLQ7c6/+2PoU AAAAEnRSTlMAEWaqu8zu//////////////95KD3bAAAACXBIWXMAAAsSAAALEgHS3X78AAAAHHRF WHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABR0RVh0Q3JlYXRpb24gVGltZQA2 LzEvMTM4qUXQAAAAbklEQVQYlWVPSRLAIAjDFbVa5f+fLYij0zYXSCAsAAzriOEsKEyghWAmj7QR RZF6L4jllh72SyVjrZgks+Al4EVUUDIP09sGNe0gWOOY95eQUPkRykp06IHXtbw4a7R6GFt0R9in j7FP/z33ef8BS24L/AXSvtcAAAAASUVORK5CYII= ------=_Part_512_29184631.1711727174844--