Creating a VM and Installing an OS
Prerequisites
VirtualBox has been installed.
Creating an Empty VM
- Open VirtualBox and click New. In the displayed Create Virtual Machine dialog box, enter a VM name, select an OS type and version, and click Next.
Take Ubuntu as an example. The type must be Linux.
Ensure that the selected version is the same as that of the OS you want to install on the VM.
Figure 1 Creating a VM - In the Memory size dialog box, set a value and click Next.
You can reference the VM specifications or official OS requirements. The minimum value is 256 MB. You can set the memory size to 512 MB as an example.
Figure 2 Setting the memory size - In the Hard disk dialog box, select Create a virtual hard disk now and click Create.
Figure 3 Creating a virtual hard disk
- In the Hard disk file type dialog box, select VHD and click Next.
Figure 4 Setting the hard disk file type
- In the Storage on physical hard disk dialog box, select Dynamically allocated and click Next.
Figure 5 Selecting the disk allocation mode
- In the File location and size dialog box, set the disk size and storage location.
For example, you can set the disk size to 20 GB.
Figure 6 Setting the disk location and size - Click Create.
Installing Linux on the VM
The procedure varies depending on the image file you use. This section uses Ubuntu 20.04 as an example.
Use an ISO file to install Linux for the empty VM. Assume that the ISO image file is Ubuntu-20.04-server.iso.
- In VirtualBox Manager, select the new VM and click Settings.
Figure 7 Setting the VM
- Choose Storage > Empty, click
in the Attributes area, and select the ISO image file Ubuntu-20.04-server.iso.
Figure 8 Selecting the ISO file to be mountedFigure 9 Mounted ISO file - Click OK.
- In VirtualBox Manager, select the new VM and click Start.
Figure 10 Starting the VM
- Install the OS.
- Select English and press Enter.
- Select Continue without updating.
- Retain the default settings for the keyboard. Select Done.
- Retain the default settings for the installation base. Select Done.
- Retain the default settings for the network. Select Done.
The installation program will automatically identify the IP address. If the network cannot be found, the installation program can still continue and you can configure the network again after the installation is complete.
- Retain the default settings for the proxy. Select Done.
- Retain the default settings for the software source. Select Done.
- Retain the default settings for disk partitioning (use an entire disk and set up this disk as an LVM group). Select Done.
The file system information will be displayed. Check it and select Done.
Confirm the destructive action and select Continue.
- Configure the server name, username, and password. Select Done.
Your name: It is not a username for logging in to the server. You can consider it as server description.
Your Server's name: It is a unique server name on the same network. The name cannot contain uppercase letters.
Pick a username: It is a username for logging in to the server. If you forget it or its password, you will not be allowed to log in to the server.
Choose a password: It is the password for logging in to the server.
Confirm your password: Enter your password again.
- Install SSH so that you can remotely connect to the Linux VM.
Select Install OpenSSH server. Then, press Tab to select Done.
- Select Done to start the OS installation.
- After the installation is complete, select Reboot to restart the system.
- Select English and press Enter.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.