2022-01-16 18:20:39 +00:00
|
|
|
---
|
|
|
|
title: "virtualbox"
|
2022-01-26 22:35:07 +00:00
|
|
|
tags: [ "Documentation", "System" ]
|
2022-01-16 18:20:39 +00:00
|
|
|
---
|
2020-01-02 00:04:35 +00:00
|
|
|
# Setup
|
|
|
|
|
|
|
|
## Arch Linux
|
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
sudo pacman -S virtualbox-host-modules-arch virtualbox-guest-iso
|
|
|
|
```
|
2020-01-02 00:04:35 +00:00
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
sudo modprobe vboxdrv
|
|
|
|
```
|
2020-01-02 00:04:35 +00:00
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
# vboxreload
|
|
|
|
```
|
2020-01-02 00:04:35 +00:00
|
|
|
|
2022-01-22 19:01:57 +00:00
|
|
|
Make dd image into vdi
|
2020-01-02 00:04:35 +00:00
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
VBoxManage convertdd base.dd output.vdi --format VDI
|
|
|
|
```
|
2020-01-02 00:04:35 +00:00
|
|
|
|
|
|
|
If this doesn't work, try to make a new bite size with just
|
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
sudo dd if=image.dd of=image2.dd bs=512 conv=sync
|
|
|
|
```
|
2020-01-02 00:04:35 +00:00
|
|
|
|
2022-01-22 19:01:57 +00:00
|
|
|
## CLI Management
|
2020-01-02 00:04:35 +00:00
|
|
|
|
|
|
|
List boxes:
|
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
VBoxManage list vms
|
|
|
|
```
|
2020-01-02 00:04:35 +00:00
|
|
|
|
|
|
|
Start a headless instance
|
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
VBoxManage startvm "rata" --type headless
|
|
|
|
```
|
2020-01-02 00:04:35 +00:00
|
|
|
|
|
|
|
To pause the machine:
|
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
VBoxManage controlvm "rata" pause --type headless
|
|
|
|
```
|
2020-01-02 00:04:35 +00:00
|
|
|
|
|
|
|
You can do a number of things to virtualboxes this way:
|
|
|
|
|
|
|
|
- startvm
|
|
|
|
|
|
|
|
- pause
|
|
|
|
|
|
|
|
- resume
|
|
|
|
|
|
|
|
- poweroff
|
|
|
|
|
2022-01-22 19:01:57 +00:00
|
|
|
## Creating Disks
|
2020-01-02 00:04:35 +00:00
|
|
|
|
|
|
|
Creating a VM requires registering it:
|
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
VBoxManage createvm --name Ubuntu19.04 --register --ostype Ubuntu
|
|
|
|
```
|
2020-01-02 00:04:35 +00:00
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
VBoxManage modifyvm Ubuntu19.04 --memory 1042
|
|
|
|
```
|
2020-01-02 00:04:35 +00:00
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
VBoxManage storagectl Ubuntu19.04 -name IDE --add ide --controller PIIX4 --bootable on
|
|
|
|
```
|
2020-01-02 00:04:35 +00:00
|
|
|
|
|
|
|
Create just a disk with:
|
|
|
|
|
|
|
|
VBoxManageg createhd --filename Ubuntu16.04 --size 5120
|
|
|
|
|
|
|
|
|