# VirtualBox

## Tips

### コマンドラインからの起動

`VBoxManage list vms`

で起動できるVM一覧を表示

起動させる

`VBoxManage startvm YOUR_VM_NAME --type headless`

動いているかどうか確認

`VBoxManage list runningvms`

停止させる

`VBoxManage controlvm YOUR_VM_NAME [ poweroff | savestate | reset | pause | resume ]`

### NATネットワークとNATの違い

<http://changineer.info/server/virtualization/virtualbox.html#_8211-4>

### 容量変更

**vdi形式**

1. "C:Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd 拡張したい仮想マシンの仮想ディスクのパス --resize 拡張後のディスク容量(MB)
2. OS起動後、gparted等で変更する

**vmdk形式**

1. "C:Program Files\Oracle\VirtualBox\VBoxManage.exe"  clonehd "box-disk1.vmdk" "cloned.vdi" --format vdi
2. "C:Program Files\Oracle\VirtualBox\VBoxManage.exe"  modifyhd "cloned.vdi" --resize 16384    # 単位はMB
3. "C:Program Files\Oracle\VirtualBox\VBoxManage.exe"  clonehd "cloned.vdi" "resized.vmdk" --format vmdk

### VirtualBox Guest Additionsのインストールでエラーとなる

<http://punio.org/blog/201408041942VVAW.html>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://yutakatay.gitbook.io/katapedia/doc/virtualbox.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
