From 583f9601a30e7191cebb7118aebeb487b4894ff0 Mon Sep 17 00:00:00 2001 From: Ste Vaidis Date: Mon, 24 Jul 2023 09:15:15 +0300 Subject: [PATCH] Add 'VirtualBox.md' --- VirtualBox.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 VirtualBox.md diff --git a/VirtualBox.md b/VirtualBox.md new file mode 100644 index 0000000..340b078 --- /dev/null +++ b/VirtualBox.md @@ -0,0 +1,55 @@ +# VirtualBox + +(https://www.virtualbox.org) + +## Installation + +```sh +apt install virtualbox virtualbox-dkms virtualbox-ext-pack virtualbox-guest-additions-iso virtualbox-qt +``` + +## Status + +```sh +VBoxManage list vms +VBoxManage list runningvms +``` + +## Start vms + +```sh +VBoxManage startvm "Rocky Linux" --type=headless +``` + + +## Stop vm + +```sh +VBoxManage controlvm SlackDB poweroff soft +``` + +## Export / Import + +```sh +VBoxManage export SlackDB --output SlackDB.ova # export +VBoxManage import SlackDB.ova # import +``` + +## Extend disk + +```sh +VBoxManage modifyhd slack.vdi --resize 102400 # MB +# 16 GB = 16384 MB +# 32 GB = 32768 MB +# 48 GB = 49152 MB +# 64 GB = 65536 MB +# 80 GB = 81920 MB +# 100 GB = 102400 MB +``` + +## Convert to KVM + +```sh +VBoxManage clonehd --format RAW .vdi .img +qemu-img convert -f raw .img -O qcow2 .qcow2 +``` \ No newline at end of file