Virtual machines

Virtual machines are emulations of computer systems that run operating systems as if they were physical hardware.

What are Virtual Machines?

Virtual machines are emulations of computer systems that allow running multiple operating systems on a single physical hardware.

Virtualization Types

By Hypervisor

  • Type 1: Bare metal hypervisor
  • Type 2: Hosted hypervisor
  • Paravirtualization: Paravirtualization
  • Hardware-assisted: Hardware-assisted

By Use

  • Server: Server virtualization
  • Desktop: Desktop virtualization
  • Application: Application virtualization
  • Network: Network virtualization

Hypervisors

Type 1 (Bare Metal)

  • VMware vSphere: VMware ESXi
  • Microsoft Hyper-V: Hyper-V Server
  • Citrix XenServer: Citrix XenServer
  • Red Hat KVM: Red Hat KVM

Type 2 (Hosted)

  • VMware Workstation: VMware Workstation
  • VirtualBox: Oracle VirtualBox
  • Parallels: Parallels Desktop
  • QEMU: QEMU

Benefits

Efficiency

  • Consolidation: Server consolidation
  • Resources: Better resource usage
  • Energy: Lower energy consumption
  • Space: Less physical space

Flexibility

  • Multiple OS: Multiple operating systems
  • Isolation: System isolation
  • Portability: VM portability
  • Scalability: Easy scalability

Costs

  • Hardware: Less hardware needed
  • Licenses: License optimization
  • Maintenance: Less maintenance
  • ROI: Better return on investment

Configuration

VMware vSphere

1
2
3
4
5
6
7
8
9
# Create VM
vmware-cmd -s createvm -c "Ubuntu Server" -d "Ubuntu Server"

# Configure resources
vmware-cmd -s setconfig -c "Ubuntu Server" -d "memSize=2048"
vmware-cmd -s setconfig -c "Ubuntu Server" -d "numvcpus=2"

# Start VM
vmware-cmd -s start "Ubuntu Server"

VirtualBox

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Create VM
VBoxManage createvm --name "Ubuntu Server" --ostype Ubuntu_64

# Configure resources
VBoxManage modifyvm "Ubuntu Server" --memory 2048 --cpus 2

# Create disk
VBoxManage createhd --filename "Ubuntu Server.vdi" --size 20000

# Start VM
VBoxManage startvm "Ubuntu Server"

Hyper-V

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Create VM
New-VM -Name "Ubuntu Server" -MemoryStartupBytes 2GB -Generation 2

# Configure resources
Set-VM -Name "Ubuntu Server" -ProcessorCount 2

# Create disk
New-VHD -Path "C:\VMs\Ubuntu Server.vhdx" -SizeBytes 20GB

# Start VM
Start-VM -Name "Ubuntu Server"

Management

Creation

  • Templates: VM templates
  • Cloning: VM cloning
  • Snapshots: Snapshots
  • Migration: VM migration

Monitoring

  • Resources: Resource monitoring
  • Performance: VM performance
  • Availability: Availability
  • Alerts: System alerts

Maintenance

  • Updates: Updates
  • Patches: Security patches
  • Backup: Backups
  • Recovery: Recovery

Security

Isolation

  • Network: Network isolation
  • Storage: Storage isolation
  • CPU: CPU isolation
  • Memory: Memory isolation

Protection

  • Antivirus: Antivirus in VMs
  • Firewall: Firewall in VMs
  • Encryption: VM encryption
  • Access Control: Access control

Monitoring

  • Logs: VM logs
  • Events: System events
  • Alerts: Security alerts
  • Audit: Audits

Best Practices

Design

  • Resources: Assign appropriate resources
  • Redundancy: Implement redundancy
  • Scalability: Plan scalability
  • Security: Security by design

Operation

  • Monitoring: Continuous monitoring
  • Maintenance: Regular maintenance
  • Backup: Regular backups
  • Testing: Regular testing

Optimization

  • Resources: Optimize resources
  • Performance: Optimize performance
  • Costs: Optimize costs
  • Efficiency: Improve efficiency

References