SoFunction
Updated on 2025-03-09

VirtualBox created Debian virtual machines share files with Windows host

the term:

1. VM: Virtual machine

step:

1. Download and install VirtualBox6.0.8 on Windows 10 (Time: 2019/5/30), download address:/virtualbox/6.0.8/VirtualBox-6.0.

or/wiki/Downloadsalternative version;

2. Start VirtualBox and create a Debian VM;

3. Download the system installation image from the Debian site, right-click the ISO image file, select "Load", insert it into the virtual optical drive to prepare for "play". The disk letter of the virtual optical drive is assumed to be "H" (this is the H disk).

Download address:/debian-cd/current/amd64/iso-cd/debian-9.9.or/distrib/netinstalternative version;

Note: If there is no "load" option, please install the soft disk first.

4. Select the VM created in step 2 in the VM list on the left side of the VirtualBox window, click the settings button (a large gear) on the upper toolbar, open the settings interface, click the "Save" option on the left to add a new disk to the VM, and the disk corresponds to the H disk.

5. Click the Run button (a big arrow) on the toolbar above the VirtualBox window to start the VM, and finally start and run the Debian installation program from the H disk. After the system installation is completed, restart the system and enter Debian;

6. Type root Enter, type the password set when installing the system Enter, and log in to the system;

Note: During the process of typing the password, there will be no corresponding output on the screen. This is just normal, and everyone understands the purpose;

8. Typeapt install linux-headers-$(uname -r)Enter, install linux headers; type shutdown Enter, and wait for the power to shut down.

9. Follow step 4, delete the corresponding H disk disk and add a new disk. The disk corresponding to the files in the VirtualBox installation directory (the path on the 64-bit operating system is: C:\Program Files\Oracle\VirtualBox; the path of the 32-bit operating system may be different)

10. Refer to steps 5 and 6 to start the computer and log in to the system again, type mkdir /mnt/vboxadd to enter, typemount /dev/cdrom /mnt/vboxaddEnter and mount the content into /mnt/vboxadd directory;

11. Typecd /mnt/vboxaddEnter and enter the directory;

12. Typesh --nox11Enter to enable debian to recognize the vboxsf file type; type shutdown to press Enter, and wait for shutdown.

13. Follow Step 4 to find the shared file option, select a folder (such as: c:\shareF) to set it to a fixed share, set the share name (such as: shareF), and other options are empty.

14. Refer to steps 5 and 6 to log in to the system again, and typemkdir  shareFromWinEnter, typemount -t vboxsf shareF shareFromWinEnter;

Completed!

Create a new text file in the folder c:\shareF in Windows, and you can also see it in the folder /root/shareFromWin in Debian, and vice versa.

Summarize

The above is the Debian virtual machine created by VirtualBox shared files with Windows hosts that the editor introduced to you. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to everyone in time. Thank you very much for your support for my website!