# How to Setup Ubuntu Server in Virtual Box

For this, we'll be needing an Ubuntu ISO file. I opted for 64-bit PC (AMD64) server install image which can be downloaded [here](https://releases.ubuntu.com/16.04/).

*The main reason I'm creating the VM is to install and test [DefectDojo](https://www.defectdojo.org/) in a Virtual Machine. *

1. Open Virtual Box and click on `New`
![5913efc804e2429cb39d15547a7decfa.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1636845222797/8CZxzrMFj.png)

2. Set the name of the VM
![77cb7e62e6ef45bdad15c3d819dd19b3.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1636845302621/vEm_zQ8rH.png)

3. For RAM, I opted for 2GB.
![04fcfc6a92234053831d660a81151b1f.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1636845336759/WtCWYtygT.png)

4. Select `Create a virtual hard disk now` for the Ubuntu Server Image
![70897c13c89845d7abbf546e834acd93.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1636848768317/v69y8XgY9.png)

5. Since, I only plan to use the image in Virtual Box, I selected VDI which is the default format used by Oracle.
	- Oracle: VDI
	- Microsoft: VHD
	- VMWare: VMDK
![db82145cc8ea4c3faf8dfd094a407be2.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1636848846428/m7VA5YU0J.png)

6. Select the `Dynamically allocated` option to avoid occupying unused virtual disk sectors.
![3a8b1dbd148947938693fa178fd2ed90.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1636848914158/3YcUaEFTP.png)

7. I set the maximum virtual hard disk size to `10.00 GB`
![0a02eaea1daf4beca8857146fd766ecf.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1636848962193/CVN1UZqUB.png)

8. Start the VM.
![0cc535db7a19425eb9c0f0cd78dcafc2.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1636848991492/12J2cT4aK.png)

9. Select the server install image file (ubuntu-16.04.7-server-amd64.iso) and click `Start`
![60f2cbe7281942d1b18d3616b3a7d722.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1636849070018/4tsC4qCxx.png)

10. Install Ubuntu Server
![f1f46192049f4181894a0ee1012b5c09.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1636849128328/6MDKWnQwF.png)

11. Login &nbsp;🚀
![1aec039176b549cca58c2694618d94ab.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1636849155497/x5jyXmJYx.png)

To scroll using the keyboard in Mac:

- ⏫  Scroll Up: `shift + fn + up arrow`
- ⏬  Scroll Down: `shift + fn + down arrow`

## Reference

- [Oracle® VM VirtualBoxUser Manual for Release 6.0: 5.2. Disk Image Files (VDI, VMDK, VHD, HDD)](https://docs.oracle.com/en/virtualization/virtualbox/6.0/user/vdidetails.html)
