VirtualBox Ubuntu 20.04: Share Folder with Windows 11 Host using EMACS tmp file creation
In this article, we will discuss how to share a folder between an Ubuntu 20.04 guest operating system running on VirtualBox and a Windows 11 host using EMACS tmp file creation. This is a useful technique for developers and power users who need to access files from both operating systems seamlessly.
Prerequisites
- A Windows 11 host with VirtualBox installed
- An Ubuntu 20.04 guest operating system running on VirtualBox
- EMACS text editor installed on the Ubuntu guest operating system
Step 1: Install Guest Additions on Ubuntu
Before we can share a folder between the Ubuntu guest and Windows host, we need to install the Guest Additions on the Ubuntu guest operating system. Guest Additions provide additional functionality to VirtualBox, including shared folders.
To install Guest Additions, follow these steps:
- Start the Ubuntu guest operating system in VirtualBox
- Select "Devices" from the VirtualBox menu, then "Insert Guest Additions CD image"
- A window will appear in Ubuntu asking if you want to run the software. Click "Run"
- Enter your password when prompted
- Follow the prompts to install the Guest Additions
Step 2: Create a Shared Folder on Windows
Next, we need to create a shared folder on the Windows host operating system. This is the folder that we will be able to access from the Ubuntu guest operating system.
To create a shared folder, follow these steps:
- Open the VirtualBox application on Windows
- Select the Ubuntu guest operating system from the list of virtual machines
- Click on the "Settings" button
- Click on the "Shared Folders" tab
- Click on the "Add" button to add a new shared folder
- Enter a name for the shared folder, and select the folder on your Windows system that you want to share
- Check the "Auto-mount" and "Make Permanent" options
- Click "OK" to save the shared folder
Step 3: Access the Shared Folder on Ubuntu
Now that we have installed Guest Additions and created a shared folder on Windows, we can access the shared folder from the Ubuntu guest operating system. We will use EMACS to create a temporary file that we can use to mount the shared folder.
To access the shared folder on Ubuntu, follow these steps:
- Open the EMACS text editor on Ubuntu
- Create a new file by typing
C-x C-f - Enter the following command to create a temporary file:
/mnt/vboxsf/<shared\_folder\_name> && rm /mnt/vboxsf/<shared\_folder\_name>Replace
<shared\_folder\_name>with the name of the shared folder that you created in Step 2. - Press
Enterto create the temporary file - EMACS will prompt you for your password. Enter your password and press
Enter - The shared folder should now be mounted on the Ubuntu guest operating system
In this article, we have discussed how to share a folder between an Ubuntu 20.04 guest operating system running on VirtualBox and a Windows 11 host using EMACS tmp file creation. This technique is useful for developers and power users who need to access files from both operating systems seamlessly. By following the steps outlined in this article, you can easily share a folder between your Ubuntu guest and Windows host.
References
-
VirtualBox Manual: Shared Folders
-
EMACS Manual: Temporary Files