Virtual Machine||Use VirtualBox to install Ubuntu detailed graphic tutorial (installation + adjust resolution + share files)

Foreword: When I was a sophomore, the teacher asked to use a virtual machine in class. I was confused when I first came into contact with it. At that time, I searched a bunch of tutorials on the Internet, and it took a lot of time to finally install it successfully. Now when I helped my brother install it again, I really don’t remember the process very well, so I plan to write a tutorial seriously, I believe it will play a lot of role in the future: )

Table of contents

1. Download the installation file

2. Install VirtualBox

3. Create a new virtual machine

Fourth, configure the virtual machine

5. Install Ubuntu

6. Change the resolution (method 1)

7. Change the resolution (method 2)

Eight, shared folder


1. Download the installation file

1. Download the VirtualBox installation file
        and click the download link: Downloads – Oracle VM VirtualBox

 2. Download ubuntu20.04

        It is not recommended to download from the official website of Ubuntu 20.04.3 LTS (Focal Fossa)
, because the download speed is too slow         . It is recommended to use the domestic mirror site to download, link: Index of /ubuntu-releases/20.04/ | Tsinghua University Open Source Software Mirror Station | Tsinghua Open Source Mirror , choose according to your own needs, the blogger's computer is Windows64, so choose the one in the picture: )

         If you don’t know who your computer is, you can open the computer’s settings, click About, and view related information


2. Install VirtualBox

1. Open the downloaded VirtualBox installation file, click "Next" all the way, pay attention to the installation location, you can change the C drive to the D drive


3. Create a new virtual machine

1. Run VirtualBox, click New

 2. The name can be chosen freely, starting from Ubuntu in the picture, the path of the folder can be changed to D disk, the type is selected as Linux, and the version is selected as Ubuntu (64-bit), because this tutorial is a tutorial for installing Ubuntu with a virtual machine, blogger The computer system is Windows 64 bit.

3. Customize the memory size and virtual hard disk of the virtual computer

Dynamic allocation means: Assuming that the limit size of the virtual hard disk file in the actual hard disk is 10G, if dynamic allocation is selected, the space occupied by the virtual hard disk in the actual hard disk is 0~10G

Fixed size means: Assuming that the maximum size of the virtual hard disk file in the actual hard disk is 10G, if you choose a fixed size, the size of the virtual hard disk occupied by the actual hard disk will always be 10G, regardless of whether the space is fully used

The limit size of the virtual hard disk file that can be used in the actual hard disk can be selected independently, as shown below, the selection is 10G in the figure, and finally click Create, and then you will find that there is an additional virtual machine named Ubuntu under the "Tools" tab.


Fourth, configure the virtual machine

1. Click the settings in the figure to start configuring the memory, CPU, and video memory of the virtual machine. The parameters can be set according to the purpose of use

2. Install the virtual disk, download the Ubuntu installation file from the Tsinghua mirror source before selecting, and copy the file downloaded in the browser to the path you are familiar with. The path in the picture is the Oracle folder under the ProgramFiles folder in the D drive.


5. Install Ubuntu

1. Click Start, click Device to assign CD-ROM drive, install Ubuntu, select Chinese, minimal installation, create an account

The name and password are customizable, but must be remembered! Click Continue and wait for the installation to complete


6. Change the resolution (method 1)

1. The installed Ubuntu display window is very small, because the resolution is too low, so the resolution needs to be modified! First of all, to open the terminal, you can use the shortcut keys left Ctrl + Alt + T, or you can right-click the desktop to open the terminal, or find the terminal icon to click

 2. Open the terminal and enter the command line: xrandr

wang@wang-VirtualBox:~$ xrandr

The result is displayed as follows:

 3. To view the relevant information of the display mode, use the command: cvt 1920 1080

 4. Add display mode, enter the following two commands, as shown in the figure

 5. Then enter the command xrandr -s 1920×1080 , and the resolution will be changed to 1920×1080. Use the command xrandr to check, and you can find that there are more resolutions to choose from.

 6. Although the resolution has been changed, it is only temporary. If you restart the system, it will return to the original state. If you want the resolution to be permanently valid, you need to modify the profile file. Open the text with the gedit text editor and enter the command sudo gedit /etc/profile

xrandr --newmode "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
xrandr --addmode Virtual1 "1920x1080_60.00"
xrandr -s 1920x1080

Finally, save the text and exit, restart the system to see if it takes effect


7. Change the resolution (method 2)

1. Click the device on the interface, choose to install enhanced functions, click Run, enter your account password, and wait for completion

2. At this time, you will find that the "Automatically adjust the display size" in the "View" becomes brighter, click to make the display window automatically fill the interface.


Eight, shared folder

1. Because the enhanced functions have been installed before. So directly modify the settings of the virtual machine for sharing

The shared folder path can be selected by yourself, remember to check the automatic mount

2. Go back to the Ubuntu system, open the terminal, and enter the command sudo mkdir /home/eve/desktop/Win10  to create a shared folder , eve is the name of my virtual machine, and Win10 is the folder I want to create;

Then enter the "Desktop" folder and enter the command sudo mount -t vboxsf shared /home/eve/desktop/Win10 to connect the shared folder of the host with the shared folder of Ubuntu. Shared in the command is the shared folder of the host. /home/eve/desktop/Win10 is a shared folder in the virtual machine

 3. But it failed (the car overturned, but in my expectation~_~||) The
reason for the failure is that the software in the CD was run when the enhanced function was installed before, so the CD needs to be ejected and reinstalled

 

 4. Find the VBoxLinuxAddition.run file in /media/tuarus_test/VBox_GAs_5.2.16, execute the run file, and wait for the installation to succeed 

 5. Since the shared folder has been created before, but the connection failed, there is no need to create a shared folder, and directly enter the command sudo mount -t vboxsf shared /home/eve/desktop/Win10 to connect the host shared folder with Ubuntu The shared folder in the command is connected, shared in the command is the shared folder of the host, and /home/eve/desktop/Win10 is the shared folder in the virtual machine

 6. Place a file in the shared folder of the host, if the file can be seen in the corresponding shared folder in Ubuntu, it means that the shared folder is created successfully.

 7. Share the pasteboard and drag and drop, change the disabled to two-way

 

Guess you like

Origin blog.csdn.net/Inochigohan/article/details/119791518