Translate

Friday, 9 November 2018

Optimization for the Host / Ubuntu interactions within the Virtual Machine



Hi !

In the previous post we installed Ubuntu 16.04.03 LTS in our Virtual Machine.

Now in this post we are going to add and configure resources of the Virtual Box that will allow us to exchange data between the Host and the Ubuntu OS running in the Virtual Machine. Which will be very convenient !!




Here are the main sections of this post for a quick jump :






Step 1 : Install the Virtual Box Guest Additions


The installation of the Virtual Box Guest Additions will add functionnalities to the VM like:

- Shared Folders, in order to exchange files between the Host and Ubuntu.

- Shared clipboard, in order to exchange copy/paste function between Host and Ubuntu

- Enable Drag and Drop, directly between Host and Ubuntu


Stage 1


So the first thing to do is to start the Virtual Machine and to log in.

Then select Devices, then Insert Guest Additions CD Image.




Stage 2


This will load the installation iso file and launch it.

An installation confirmation popup will show up.




Just click Run.


Stage 3


A Ubuntu upgrade request popup might show up !

Check this !

As we used the specific Ubuntu version 16.04.03 LTS compatible with the XILINX's VIVADO 2018.2 tools, DO NOT UPGRADE Ubuntu !


To proceed with the Additions installation, an authentification popup will ask you for your password.

Just provide your Password and click Authenticate.




Stage 4


The installation will start and log is provided in a terminal window.

This will last a few minutes.

You will have to end the process by pressing Enter.




Stage 5


To finalize this installation procedure, eject the installation iso file.

Select Devices, then Optical Drives and Eject disk from virtual drive.




Check this !

Now you have to reboot your Virtual Machine !






Step 2 : Enable the shared folders


The Virtual Box Guest Additions will let you exchange files between the Host and the Ubuntu OS.


Stage 1


The first thing to do is to create a folder on the Host Hard Drive.

For me I chose to create the folder share on my dedicated hard drive DE_LINUX.




Stage 2


Then go back to the Virtual Machine. Start it and log in.

Go to Devices, then select Shared folder and finaly Shared Folders Settings.




Stage 3


First select the Permanent Folders.

Then, on the right click on the Add icon.

This will popup a window where:

- Select your share folder path on the Host hard drive

- Select Auto Mount

- Select Permanent Configuration

Finaly click Ok




And you will get the following configuration :




Check this !

Now you have to reboot your Virtual Machine !


Stage 4


Check this !

The repository created on the Host hard drive will be seen in Ubuntu as /media/sf_<host_repo_name>


If we try to access the shared repository using the Ubuntu's repo browser we get :




Stage 5


Now we will provide the needed permissions.

In the Ubuntu's desktop click right to Open Terminal.

A terminal window opens.

We need to provide permissions to the vboxsf group.

First we check that the group has been created by the Guest Additions installation. Use the following command line.




Next, I give myself the permissions to that group and check it was applied. Use the following command lines.




You will have to provide your password.


Check this !

Now you have to reboot your Virtual Machine !


Stage 6


In the Host explorer I created a file called Test_file.txt.

Now when I use the Ubuntu file explorer I can see that file in the shared repository and I can access and modify it.




If I do the same in the terminal window :








Step 3 : Enable the shared clipboard


The Virtual Box Guest Additions will let you copy/paste data between the Host and the Ubuntu OS.


Stage 1


In the VM go to Devices, then select Shared clipboard and finaly Bidirectionnal.




Stage 2


Ok, let's try it !

In the Host I write some text in my text editor that I copy to the Host's clipboard.




Now back to Ubuntu, if I open a terminal window and make a paste function, I get my text back !

This will be very helpfull for me for my posts !!!



And of course it works backward from Ubuntu's Copy function to the Host's Paste function.






Step 4 : Enable the Drag and Drop capability


The Virtual Box Guest Additions will let you Drag and Drop data between the Host and the Ubuntu OS.


Stage 1


In the VM go to Devices, then select Drag and Drop and finaly Bidirectionnal.




Check this !

Now you have to reboot your Virtual Machine !


I experienced problems with very small files.....






Step 5 : Optimizations



Stage 1


There you can give more CPU power to the VM execution.

First, Shut Down your Virtual Machine to gain access to its configuration parameters.

Next, click on the System sub section title.

Select the Processor tab.

Be carefull to keep enougth CPU for the Host !

Recommandation would be 50 / 50.







Post Conclusion

Now we have :

- Convenient ways to exchange data between the Host and the Virtual Machine (Shared Folders, Shared Clipboard, Drag and Drop)
- Virtual Machine Optimization

No comments:

Post a Comment