Virtual box implements centos and windows shared folders, virtualcentos
I encountered many errors during the implementation of centos (in virtualbox) and windows Shared Folders. I spent one afternoon to do this. First, I will not discuss how to configure shared folders, this section describes the many errors encountered during the configuration process.
- Choose "device"> "Install Guest Additions" from the VirtualBox menu )"
- A cd will appear on the desktop. Enter the following in the command line:
- Cd/media/VBOXADDITIONS_4.3.12_93733/
- Enter sudo./VBoxLinuxAdditions. run
- Then the magic thing happened. When the enhancement package was installed, an error occurred, as shown below:
- Building the main Guest Additions module [FAILED]
- (Look at/var/log/vboxadd-install.log to find out what went wrong)
- Are VirtualBox versions old? Therefore, updating VirtualBox does not help
- So go to the log to view what happened (/var/log/vboxadd-install.log)
- The log contains the following information: (Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR = <directory> and run Make again)
- It's strange that I don't know the current linux kernel source. On a foreign language website, I found that foreigners have encountered the same problem. After a long time, I finally got an effect.
- First, we tried the following command:
- $ Sudo yum updatettings
- $ Sudo yum install kernel-devel gcc
- $ Echo export KERN_DIR =/usr/src/kernels/'uname-R'> ~ /. Bashrc
- Then I tried the following command:
- Yum install kernel * dkms gcc
- Then
- Yum install kernel-uek-devel
- Then reboot your machine
- After the upgrade, try to reinstall the enhancement package. The problem persists. After the restart, try the two Commands: yum install kernel * dkms gcc; yum install kernel-uek-devel, install the enhancement package:
Installing additional modules... removing existing VirtualBox non-DKMS kernel modules [OK] Building the VirtualBox Guest Additions kernel modulesBuilding the main Guest Additions module [OK] Building the shared folder support module [OK] Building the OpenGL support module [OK] Doing non-kernel setup of the Guest Additions [OK] Starting the VirtualBox Guest Additions [OK] Installing the Window System driversInstalling X. org Server 1.13 modules [OK] Setting up the Window System to use the Guest Additions [OK] You may need to restart the hal service and the Window System (or just restartthe guest system) to enable the Guest Additions. |
Finally, we can see the green OK. It's really not easy. Then we continue to mount-t vboxsf linux_share/mnt/share. linux_share is the shared file name set in VirtualBox, /mnt/share is the folder created in centos. Note that the names of the two folders are not the same at the end to prevent other errors.
- Later, during the test, I used xshell and found that this item does not support Chinese. It is really awkward for Chinese people, especially programmers. Fortunately, I found this on the Internet, good stuff. Share it.
- Http://moralistxp.blog.163.com/blog/static/1161103982013112411540183/
- Http://jingyan.baidu.com/article/3ea51489eca4b452e61bbaca.html
- You can add linux_share/mnt/share vboxsf rw to/etc/fstab if you do not want to manually attach each time, gid = 100, uid = 1000, auto 0 0, will be automatically loaded each time the boot. Tested and available.
- Use umount-f/mnt/share if you want to uninstall it. If umount2: Device or resource busy appears
- Umount:/mnt/share: device is busy.
- (In some cases useful info about processes that use
- The device is found by lsof (8) or fuser (1 ))
- Umount2: Device or resource busy
- This indicates that you have not exited the directory or the mounting device is in use.
- If there are uncertain places, you can refer to the http://jingyan.baidu.com/article/2fb0ba40541a5900f2ec5f07.html
In Virtualbox shared folder settings, automatic mounting is required?
The system in the virtual machine automatically loads your d disk as soon as it is started.
What system does your VM have? For windows, check whether there is an extra drive letter in the resource manager. For linux, there should be a subdirectory starting with sf _ in the/media directory. After reading this, shut down the virtual machine, cancel the automatic mounting, and then repeat the previous operation on the virtual machine.
How does VirtualBox install Ubuntu shared files in Windows?
VirtualBox can exchange data between hosts and virtual machines by allocating data space. First install the enhancement package for the virtual machine, and then add a fixed allocated data space in the "data space", and change the name to share (the name can be set as needed ).
If the virtual machine is a Linux system, take Ubuntu as an example. Assume that the Mount directory is/home/aaa/folder file (this folder must be set up first, for example,/home/aaa/ccc can be set as needed)
Run the following command on the terminal:
Sudo mount-t vboxsf share/home/aaa/upload file/
In this case, open the hosts file folder, which contains the file content in the host share.
To cancel mounting, run the following command:
Sudo umount/home/aaa/upload file/
This can be
Then, cancel the space allocation in VirtualBox.