lk/virtualization/virtualbox.md

84 lines
1.1 KiB
Markdown
Raw Normal View History

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
```bash
sudo pacman -S virtualbox-host-modules-arch virtualbox-guest-iso
```
2020-01-02 00:04:35 +00:00
```bash
sudo modprobe vboxdrv
```
2020-01-02 00:04:35 +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
```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
```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:
```bash
VBoxManage list vms
```
2020-01-02 00:04:35 +00:00
Start a headless instance
```bash
VBoxManage startvm "rata" --type headless
```
2020-01-02 00:04:35 +00:00
To pause the machine:
```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:
```bash
VBoxManage createvm --name Ubuntu19.04 --register --ostype Ubuntu
```
2020-01-02 00:04:35 +00:00
```bash
VBoxManage modifyvm Ubuntu19.04 --memory 1042
```
2020-01-02 00:04:35 +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