Win-Virtualbox Technical Documentation

Win-Virtualbox Technical Documentation.md

tags: Virtual Machine Virtualbox November 2019

Introduction Description

VirtualBox Known as the best free virtual machine software, it not only has rich features, but also has excellent performance!It is easy to use, and virtual systems include Windows (from Windows 3.1 to Windows 10, Windows Server 2012, all Windows systems support), Mac OS X, Linux, OpenBSD, Solaris, IBM OS2, and even Android operating systems!Users can install and run these operating systems on VirtualBox!VirtualBox is unique in that it supports Remote Desktop Protocol (RDP), iSCSI, and USB in comparison to VMware and Virtual PC of the same nature. VirtualBox already supports USB 2.0 hardware devices on client operating systems, but VirtualBox Extension Pack should be installed.

Matters needing attention:

  • Win command, double quotation marks for path. (Avoid special characters)

Common Virtualbox commands

Reference link:

# >>>>>>>> Format conversion<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
# Format Conversion VDI to VMDK
VBoxManage clonehd "source.vdi" "target.vmdk" --format VMDK
# Format Conversion VMDK to VDI
VBoxManage clonehd "source.vmdk" "target.vdi" --format VDI

# >>>>>>> View information<<<<<<<<<<<<<<<<<<<<<<<<<<
# See which virtual machines are available
VBoxManage list vms
# View virtual details
VBoxManage list vms --long
# View running virtual machines
VBoxManage list runningvms
# List information about virtual disks currently in use by VirtualBox
VBoxManage list hdds
# Lists information about virtual disk mirrors loaded in the virtual machine configuration file
VBoxManage list dvds

# List all client operating systems recognized by VirtualBox
VBoxManage list ostypes
# Displays the Host's Hardware time, CPU, memory, operating system, and system version information
VBoxManage list hostinfo # (Processor count in output refers to the number of threads in the CPU)
# List all virtual disk backends supported by VirtualBox
VBoxManage list hddbackends
# Displays some global setting information for VirtualBox, including the path to the Guest Additions file
VBoxManage list systemproperties
# Display configuration information for virtual machines
VBoxManage showvminfo <uuid>|<name>
# Detailed display of virtual machine configuration information
VBoxManage showvminfo <uuid>|<name> [--details]




# >>>>>>> Opens <<<<<<<<<<<<<<<<<<<<<<<<<<<<
# Turn on virtual machine to run in the background
VBoxManage startvm backup -type headless
# Support for turning on virtual machines and remote desktop connections
VBoxManage startvm <vm_name> -type vrdp

# Change the remote connection port of the virtual machine for multiple vbox virtual machines to run at the same time
VBoxManage controlvm <vm_name> vrdpprot <ports>

# >>>>>>> Close<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
# Turn off virtual machines
VBoxManage controlvm <vm_name> acpipowerbutton
# Force virtual machine shutdown
VBoxManage controlvm <vm_name> poweroff

# >>>>>>> Snapshots<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
# Create a snapshot called base for centos7
VBoxManage snapshot "centos7" take base
# Delete a snapshot named base for virtual machine centos7
VBoxManage snapshot "centos7" delete base

# >>>>>>>>> Expansion Pack<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
# Add a new extension package
VBoxManage extpack install <.vbox-extpack>
# Uninstall the specified extension pack
VBoxManage extpack uninstall <name>
# Show installed expansion packs
VBoxManage list extpacks
# Remove files and directories that may be left behind if an extension package installation or uninstallation fails
VBoxManage extpack cleanup

Functional Configuration

Configure that non-root users can access host files

Reference link: Shared directories are inaccessible to non-root users under virtualbox+centos

Reason for the problem: The shared directory user group is vboxsf, and non-root users belong to different user groups, so they cannot be accessed.

Solution:

# 1. Under root user
usermod -a -G wheel userName
# 2. Under Current User
sudo usermod -aG vboxsf $(whoami)
# 3. Restart or log off users
su - $(whoami)
# Host files can be viewed normally

Dynamic and fixed disks convert to each other

Reference link: Conversion between Virtualbox fixed and dynamic disks

Pre-instructions:

  • Virtual machine shutdown and backup (export OVA format, etc.)

Actual steps to convert a dynamic disk to a fixed disk

# Switch directories
[C:\~]$ cd C:\Program Files\Oracle\VirtualBox
[C:\Program Files\Oracle\VirtualBox]$
# List current hard disk information
[C:\Program Files\Oracle\VirtualBox]$  VBoxManage.exe list hdds
UUID:           782ec60c-da8e-4308-994c-fff7e8e3594d
Parent UUID:    base
State:          locked write
Type:           normal (base)
Location:       D:\10-Software Data\Virtualbox\CentOS7.5_My HugeGraph\CentOS7.5_My HugeGraph-disk001.vmdk
Storage format: VMDK
Capacity:       204800 MBytes
Encryption:     disabled
# Convert a fixed disk to a dynamic disk
[C:\Program Files\Oracle\VirtualBox]$ VBoxManage.exe clonemedium disk "D:\10-Software Data\Virtualbox\CentOS7.5_My HugeGraph\CentOS7.5_My HugeGraph-disk001.vmdk" "D:\10-Software Data\Virtualbox\CentOS7.5_My HugeGraph\Centos75.vdi" -variant Standard
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Clone medium created in format 'VMDK'. UUID: 38a0c1d3-cc6f-427c-8dc4-fb33a50a0b24
# Convert Dynamic Disk to Fixed Disk
# [C:\\Program Files\\Oracle\VirtualBox]$VBoxManage.exe clonemedium disk "D:\10-software data\10-software data\\\\\Software data\\\Virtualbox\\-software data\\10-software data\\10-software data\\CentOS7 HugeHugeHugeHugevdi" -variant Fixed
# 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
# Clone medium created in format 'VMDK'. UUID: 4f4952d3-6754-4267-8ffa-0e06f12d1449
# List current hard disk information
[C:\Program Files\Oracle\VirtualBox]$ VBoxManage.exe list hdds
UUID:           782ec60c-da8e-4308-994c-fff7e8e3594d
Parent UUID:    base
State:          created
Type:           normal (base)
Location:       D:\10-Software Data\Virtualbox\CentOS7.5_My HugeGraph\CentOS7.5_My HugeGraph-disk001.vmdk
Storage format: VMDK
Capacity:       204800 MBytes
Encryption:     disabled

UUID:           4f4952d3-6754-4267-8ffa-0e06f12d1449
Parent UUID:    base
State:          created
Type:           normal (base)
Location:       D:\10-Software Data\Virtualbox\CentOS7.5_My HugeGraph\Centos75_fixed.vdi
Storage format: VMDK
Capacity:       204800 MBytes
Encryption:     disabled

Disconnect the virtual machine from the old hard drive and add a new one

Delete the original hard disk (you can click to see the hard disk, it will show whether the hard disk is allocated, the unassigned hard disk can be deleted as needed)
()

Virtualbox Hard Disk Expansion

Virtualbox Hard Disk Compression

vmdk Compressed Slim Virtual Machine Hard Disk and Mounted in VirtualBox

Enclosure

Reference Links

problem

50 original articles published. 10% praised. 50,000 visits+
Private letter follow

Tags: VirtualBox Oracle Windows snapshot

Posted on Sat, 01 Feb 2020 20:05:51 -0500 by zachatk1