---
title: "Install VBox Guest Addons And Auto Mount VBox Shared Folders"
author: "lixuanbin"
date: "2015-04-04T22:23:31Z"
tags: ["CentOS", "Linux", "RedHat"]
categories: ["操作系统"]
slug: "install-vbox-guest-addons-and-auto-mount-vbox-shared-folders"
draft: false
lastmod: "2015-04-04T22:25:39Z"
id: 2199393
url: "https://lixuanbin.iteye.com/blog/2199393"
---

1\. Mount the Guest Addons in VirtualBox:  
Devices &gt;&gt; Insert Guest Additions  
![](http://dl2.iteye.com/upload/attachment/0107/2875/7deee8e9-b70d-3377-a668-ebbf364e36cf.png)

 

```
mount /dev/cdrom /mnt
cd /mnt
./VBoxLinuxAdditions.run --nox11
```

   
2\. if you get this error: "Unable to find the sources of current Linux kernel", then:

 

```
yum install kernel-devel
yum group install "Development Tools"
yum install kernel-headers-$(uname -r)
./VBoxLinuxAdditions.run --nox11
```

 

 

3\. Add and auto mount vbox shared folder:  
![](http://dl2.iteye.com/upload/attachment/0107/2879/1f5d890c-01d2-3750-8791-81994bd1081d.png)  
 

```
mount | grep vbox
```

 

![](http://dl2.iteye.com/upload/attachment/0107/2883/276f642b-0865-33ea-b80a-f5fc94026de4.png)

 

```
vim /etc/fstab
```

Append the following and reboot:

```
/media/sf_vb-share /desired/mount/point bind defaults,bind 0 0
```

   
4\. Reference:  
[http://www.turnkeylinux.org/docs/virtualbox-guest-addons](http://www.turnkeylinux.org/docs/virtualbox-guest-addons)  
[http://www.cyberciti.biz/faq/centos-rhel-7-redhat-linux-install-gcc-compiler-development-tools/](http://www.cyberciti.biz/faq/centos-rhel-7-redhat-linux-install-gcc-compiler-development-tools/)  
[https://forums.virtualbox.org/viewtopic.php?f=7&t=47862](https://forums.virtualbox.org/viewtopic.php?f=7&t=47862)  
[https://forums.virtualbox.org/viewtopic.php?t=15868](https://forums.virtualbox.org/viewtopic.php?t=15868)