ubuntu主机,xubuntu虚拟机,虚拟机共享主机文件夹失败[已解决]
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
- xwp911
- 帖子: 137
- 注册时间: 2013-01-13 21:26
- 系统: ubuntu14.04
ubuntu主机,xubuntu虚拟机,虚拟机共享主机文件夹失败[已解决]
如题,宿主机为ubuntu14.04,虚拟机为vbox下的xubuntu14.04,在vbox虚拟机中已经指定主机中的333文件夹作为共享。在虚拟机中的终端上命令行:
xwp@xwp-VirtualBox:~$ ls
ds1 公共的 模板 视频 图片 文档 下载 音乐 桌面
xwp@xwp-VirtualBox:~$ sudo mount -t vboxsf 333 ~/ds1
[sudo] password for xwp:
mount:文件系统类型错误、选项错误、333 有坏超级块,
缺少代码页或助手程序,或其他错误
(对某些文件系统(如 nfs、cifs) 您可能需要
一款 /sbin/mount.<类型> 助手程序)
有些情况下在 syslog 中可以找到一些有用信息- 请尝试
dmesg | tail 这样的命令看看。
xwp@xwp-VirtualBox:~$
问题何在?
同样命令在虚拟机mint17中顺利实现。
xwp@xwp-VirtualBox:~$ ls
ds1 公共的 模板 视频 图片 文档 下载 音乐 桌面
xwp@xwp-VirtualBox:~$ sudo mount -t vboxsf 333 ~/ds1
[sudo] password for xwp:
mount:文件系统类型错误、选项错误、333 有坏超级块,
缺少代码页或助手程序,或其他错误
(对某些文件系统(如 nfs、cifs) 您可能需要
一款 /sbin/mount.<类型> 助手程序)
有些情况下在 syslog 中可以找到一些有用信息- 请尝试
dmesg | tail 这样的命令看看。
xwp@xwp-VirtualBox:~$
问题何在?
同样命令在虚拟机mint17中顺利实现。
上次由 xwp911 在 2014-08-07 22:08,总共编辑 2 次。
-
- 论坛版主
- 帖子: 18279
- 注册时间: 2009-08-04 16:33
Re: ubuntu主机,xubuntu虚拟机,虚拟机共享主机文件夹失败
sudo ls -al / | grep home
sudo ls -al /home/username
sudo ls -al /home/username | grep ds1
把結果直接複製 貼上來
這裡的 username 指你登入使用的帳號
sudo ls -al /home/username
sudo ls -al /home/username | grep ds1
把結果直接複製 貼上來
這裡的 username 指你登入使用的帳號
- xwp911
- 帖子: 137
- 注册时间: 2013-01-13 21:26
- 系统: ubuntu14.04
Re: ubuntu主机,xubuntu虚拟机,虚拟机共享主机文件夹失败
xwp@xwp-VirtualBox:~$poloshiao 写了:sudo ls -al / | grep home
sudo ls -al /home/username
sudo ls -al /home/username | grep ds1
把結果直接複製 貼上來
這裡的 username 指你登入使用的帳號
xwp@xwp-VirtualBox:~$ sudo ls -la / |grep home
[sudo] password for xwp:
drwxr-xr-x 4 root root 4096 7月 11 19:48 home
xwp@xwp-VirtualBox:~$ sudo ls -la /home/xwp
总用量 260
drwx------ 18 xwp xwp 4096 8月 5 08:58 .
drwxr-xr-x 4 root root 4096 7月 11 19:48 ..
-rw------- 1 xwp xwp 696 8月 5 09:11 .bash_history
-rw-r--r-- 1 xwp xwp 220 7月 11 19:48 .bash_logout
-rw-r--r-- 1 xwp xwp 3637 7月 11 19:48 .bashrc
drwx------ 11 xwp xwp 4096 8月 5 11:42 .cache
drwx------ 9 xwp xwp 4096 7月 13 16:08 .config
-rw-r--r-- 1 xwp xwp 41 7月 18 16:50 .dmrc
drwxrwxr-x 2 xwp xwp 4096 8月 5 08:52 ds1
lrwxrwxrwx 1 xwp xwp 29 7月 11 19:48 .ecryptfs -> /home/.ecryptfs/xwp/.ecryptfs
drwx------ 3 xwp xwp 4096 8月 5 08:58 .gconf
-rw------- 1 xwp xwp 1400 8月 5 08:57 .ICEauthority
drwxrwxr-x 3 xwp xwp 4096 7月 11 20:16 .local
drwx------ 4 xwp xwp 4096 7月 13 16:07 .mozilla
lrwxrwxrwx 1 xwp xwp 28 7月 11 19:48 .Private -> /home/.ecryptfs/xwp/.Private
-rw-r--r-- 1 xwp xwp 675 7月 11 19:48 .profile
drwx------ 2 xwp xwp 4096 7月 18 17:13 .ssh
drwx------ 3 xwp xwp 4096 7月 11 20:19 .thumbnails
-rw-r----- 1 xwp xwp 5 8月 5 08:57 .vboxclient-clipboard.pid
-rw-r----- 1 xwp xwp 5 8月 5 08:57 .vboxclient-display.pid
-rw-r----- 1 xwp xwp 5 8月 5 08:57 .vboxclient-draganddrop.pid
-rw-r----- 1 xwp xwp 5 8月 5 08:57 .vboxclient-seamless.pid
-rw------- 1 xwp xwp 59 8月 5 08:57 .Xauthority
-rw-r--r-- 1 xwp xwp 1601 7月 11 19:48 .Xdefaults
-rw-r--r-- 1 xwp xwp 14 7月 11 19:48 .xscreensaver
-rw------- 1 xwp xwp 216 8月 5 08:57 .xsession-errors
-rw------- 1 xwp xwp 321 8月 5 08:53 .xsession-errors.old
drwxr-xr-x 2 xwp xwp 4096 7月 11 20:16 公共的
drwxr-xr-x 2 xwp xwp 4096 7月 11 20:16 模板
drwxr-xr-x 2 xwp xwp 4096 7月 11 20:16 视频
drwxr-xr-x 2 xwp xwp 4096 7月 11 20:16 图片
drwxr-xr-x 2 xwp xwp 4096 7月 11 20:16 文档
drwxr-xr-x 2 xwp xwp 4096 7月 11 20:16 下载
drwxr-xr-x 2 xwp xwp 4096 7月 11 20:16 音乐
drwxr-xr-x 2 xwp xwp 4096 7月 11 20:16 桌面
xwp@xwp-VirtualBox:~$ sudo ls -al /home/xwp |grep ds1
drwxrwxr-x 2 xwp xwp 4096 8月 5 08:52 ds1
xwp@xwp-VirtualBox:~$
-
- 论坛版主
- 帖子: 18279
- 注册时间: 2009-08-04 16:33
Re: ubuntu主机,xubuntu虚拟机,虚拟机共享主机文件夹失败
改為sudo mount -t vboxsf 333 ~/ds1
mount -t vboxsf 333 ~/ds1
試試
如果有錯誤訊息
請直接複製貼上來
另外
你已經在 Guest 執行了
VBoxLinuxAdditions.run
了沒
如果已經執行了 並且已經重開機
從 Guest 終端機
sudo ls -al /media | grep sf_333
sudo ls -al /media/sf_333
看看有沒有內容
如果有錯誤訊息
請直接複製貼上來
- xwp911
- 帖子: 137
- 注册时间: 2013-01-13 21:26
- 系统: ubuntu14.04
Re: ubuntu主机,xubuntu虚拟机,虚拟机共享主机文件夹失败
xwp@xwp-VirtualBox:~$ mount -t vboxsf 333 ~/ds1poloshiao 写了:改為sudo mount -t vboxsf 333 ~/ds1
mount -t vboxsf 333 ~/ds1
試試
如果有錯誤訊息
請直接複製貼上來
另外
你已經在 Guest 執行了
VBoxLinuxAdditions.run
了沒
如果已經執行了 並且已經重開機
從 Guest 終端機
sudo ls -al /media | grep sf_333
sudo ls -al /media/sf_333
看看有沒有內容
如果有錯誤訊息
請直接複製貼上來
挂臷:只有 root 用户才能执行
xwp@xwp-VirtualBox:~$ sudo ls -la /media |grep sf_333
xwp@xwp-VirtualBox:~$ sudo ls -al /media/sf_333
ls: 无法访问/media/sf_333: 没有那个文件或目录
xwp@xwp-VirtualBox:~$
我昨天又重新在vbox中安装了一次xubuntu14.04,并安装了系统增强功能。更新了系统,但是仍然是这个样子。很奇怪,虚拟机中的mint17就没有问题。

- xwp911
- 帖子: 137
- 注册时间: 2013-01-13 21:26
- 系统: ubuntu14.04
Re: ubuntu主机,xubuntu虚拟机,虚拟机共享主机文件夹失败
难道我这个版本有问题?
发现重启会黑屏不动,不知怎么回事。
发现重启会黑屏不动,不知怎么回事。
-
- 论坛版主
- 帖子: 18279
- 注册时间: 2009-08-04 16:33
Re: ubuntu主机,xubuntu虚拟机,虚拟机共享主机文件夹失败
猜測宿主机为ubuntu14.04,虚拟机为vbox下的xubuntu14.04
sudo ls -la /media |grep sf_333
sudo ls -al /media/sf_333
ls: 无法访问/media/sf_333: 没有那个文件或目录
1. 333 分享目錄 沒有在 虛擬機 / 設定值 / 共用資料夾 正確設定
特別是 自動掛載 有沒有打勾 ? 如果有 在公用資料夾 自動掛載 欄位 看到的 應該是 是
2. 在 Guest Addition 沒有正確安裝
2-1. 從 guest 終端機
sudo mount /dev/sr0 /mnt
或
sudo mount /dev/sr1 /mnt
或
sudo mount /dev/sr2 /mnt
或
....
需看你的 Guest Addition ISO 在設定框/存放裝置 排在第幾順位
2-2. 看看有沒有 VBoxLinuxAdditions.run
sudo ls -al /mnt | grep VBoxLinuxAdditions.run # 注意大小寫
2-3. 如果有 VBoxLinuxAdditions.run
sudo /mnt/VBoxLinuxAdditions.run
開始安裝 Guest Addition for Linux
2-4. Guest 重新開機 登入桌面 登入桌面
2-4-1. sudo ls -la /media |grep sf_333
應該可以看到 sf_333 目錄
2-4-2. sudo ls -al /media/sf_333
應該可以看到 sf_333 目錄內的內容
3. 如果 還是有問題
檢查一下 Host / 333 分享資料夾 從 / 開始的整條路徑 權限設定
- xwp911
- 帖子: 137
- 注册时间: 2013-01-13 21:26
- 系统: ubuntu14.04
Re: ubuntu主机,xubuntu虚拟机,虚拟机共享主机文件夹失败
poloshiao 写了: 猜測
1. 333 分享目錄 沒有在 虛擬機 / 設定值 / 共用資料夾 正確設定
特別是 自動掛載 有沒有打勾 ? 如果有 在公用資料夾 自動掛載 欄位 看到的 應該是 是
同样一个目录,在vbox的两个linux虚拟机中,一个可以,一个不行。且可以的那个也没有勾选‘自动挂载’,不可以的那个选择‘自动挂载’等选项也失败。poloshiao 写了: 3. 如果 還是有問題
檢查一下 Host / 333 分享資料夾 從 / 開始的整條路徑 權限設定
我下载的是vbox增强系统的iso,在虚拟机中运行其中的autorun.sh。两个虚拟机都是这样运行的。 运行autorun.sh后,如下:poloshiao 写了: 2. 在 Guest Addition 沒有正確安裝
2-1. 從 guest 終端機
sudo mount /dev/sr0 /mnt
或
sudo mount /dev/sr1 /mnt
或
sudo mount /dev/sr2 /mnt
或
....
需看你的 Guest Addition ISO 在設定框/存放裝置 排在第幾順位
2-2. 看看有沒有 VBoxLinuxAdditions.run
sudo ls -al /mnt | grep VBoxLinuxAdditions.run # 注意大小寫
2-3. 如果有 VBoxLinuxAdditions.run
sudo /mnt/VBoxLinuxAdditions.run
開始安裝 Guest Addition for Linux
2-4. Guest 重新開機 登入桌面 登入桌面
2-4-1. sudo ls -la /media |grep sf_333
應該可以看到 sf_333 目錄
2-4-2. sudo ls -al /media/sf_333
應該可以看到 sf_333 目錄內的內容
-
- 论坛版主
- 帖子: 18279
- 注册时间: 2009-08-04 16:33
Re: ubuntu主机,xubuntu虚拟机,虚拟机共享主机文件夹失败
1. 你安裝的 Guest Addition 是 4.3.10 版我下载的是vbox增强系统的iso,在虚拟机中运行其中的autorun.sh。
你安裝的 Virtualbox 是哪個版本 ?
2. 當你安裝 Virtualbox 的 時候 就會同時安裝同一個版本的 Guest Addition 的 ISO 在
/usr/share/virtualbox/VBoxGuestAdditions.iso
3. 直接拿這個 VBoxGuestAdditions.iso 掛載在 設定框/存放裝置
可以保證 同一個版本
4. 重新下載 要確認是否是 同一個版本
- xwp911
- 帖子: 137
- 注册时间: 2013-01-13 21:26
- 系统: ubuntu14.04
Re: ubuntu主机,xubuntu虚拟机,虚拟机共享主机文件夹失败
版本一致啊,不过原先我真不知道/usr/share/virtualbox/VBoxGuestAdditions.isopoloshiao 写了:1. 你安裝的 Guest Addition 是 4.3.10 版我下载的是vbox增强系统的iso,在虚拟机中运行其中的autorun.sh。
你安裝的 Virtualbox 是哪個版本 ?
2. 當你安裝 Virtualbox 的 時候 就會同時安裝同一個版本的 Guest Addition 的 ISO 在
/usr/share/virtualbox/VBoxGuestAdditions.iso
3. 直接拿這個 VBoxGuestAdditions.iso 掛載在 設定框/存放裝置
可以保證 同一個版本
4. 重新下載 要確認是否是 同一個版本

-
- 论坛版主
- 帖子: 18279
- 注册时间: 2009-08-04 16:33
Re: ubuntu主机,xubuntu虚拟机,虚拟机共享主机文件夹失败
你的 333 分享目錄 原來在 Host 的 絕對路徑 ?
-
- 论坛版主
- 帖子: 18279
- 注册时间: 2009-08-04 16:33
Re: ubuntu主机,xubuntu虚拟机,虚拟机共享主机文件夹失败
這是我剛剛執行选区_045.png
sudo /mnt/VBoxLinuxAdditions.run
的終端機文字訊息
你核對一下 有何不同
sudo /mnt/VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.3.14 Guest Additions for Linux............
VirtualBox Guest Additions installer
Removing installed version 4.3.12 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
Removing existing VirtualBox DKMS kernel modules ...done.
Removing existing VirtualBox non-DKMS kernel modules ...done.
Building the VirtualBox Guest Additions kernel modules ...done.
Doing non-kernel setup of the Guest Additions ...done.
You should restart your guest to make sure the new modules are actually used
Installing the Window System drivers
Installing X.Org Server 1.15 modules ...done.
Setting up the Window System to use the Guest Additions ...done.
You may need to restart the hal service and the Window System (or just restart
the guest system) to enable the Guest Additions.
Installing graphics libraries and desktop services components ...done.
Guest :
sudo cat /etc/group | grep vboxsf
看看有沒有你登入 guest 的 username 在裡面
如果沒有
把你登入 guest 的 username 加入 group boxsf 看看
sudo usermod -G boxsf username
- xwp911
- 帖子: 137
- 注册时间: 2013-01-13 21:26
- 系统: ubuntu14.04
Re: ubuntu主机,xubuntu虚拟机,虚拟机共享主机文件夹失败
xwp@xwp-VirtualBox:~$ sudo /media/xwp/VBOXADDITIONS_4.3.10_93012/VBoxLinuxAdditions.runpoloshiao 写了:這是我剛剛執行选区_045.png
sudo /mnt/VBoxLinuxAdditions.run
的終端機文字訊息
你核對一下 有何不同
sudo /mnt/VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.3.14 Guest Additions for Linux............
VirtualBox Guest Additions installer
Removing installed version 4.3.12 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
Removing existing VirtualBox DKMS kernel modules ...done.
Removing existing VirtualBox non-DKMS kernel modules ...done.
Building the VirtualBox Guest Additions kernel modules ...done.
Doing non-kernel setup of the Guest Additions ...done.
You should restart your guest to make sure the new modules are actually used
Installing the Window System drivers
Installing X.Org Server 1.15 modules ...done.
Setting up the Window System to use the Guest Additions ...done.
You may need to restart the hal service and the Window System (or just restart
the guest system) to enable the Guest Additions.
Installing graphics libraries and desktop services components ...done.
Guest :
sudo cat /etc/group | grep vboxsf
看看有沒有你登入 guest 的 username 在裡面
如果沒有
把你登入 guest 的 username 加入 group boxsf 看看
sudo usermod -G boxsf username
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.3.10 Guest Additions for Linux............
VirtualBox Guest Additions installer
Removing installed version 4.3.10 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
Removing existing VirtualBox non-DKMS kernel modules ...done.
Building the VirtualBox Guest Additions kernel modules
The headers for the current running kernel were not found. If the following
module compilation fails then this could be the reason.
Building the main Guest Additions module ...done.
Building the shared folder support module ...done.
Building the OpenGL support module ...done.
Doing non-kernel setup of the Guest Additions ...done.
You should restart your guest to make sure the new modules are actually used
Installing the Window System drivers
Installing X.Org Server 1.15 modules ...done.
Setting up the Window System to use the Guest Additions ...done.
You may need to restart the hal service and the Window System (or just restart
the guest system) to enable the Guest Additions.
Installing graphics libraries and desktop services components ...done.
在/etc/group中vboxsf一行加入username没有用。我查看了我的mint17中也是没有username的,也没事。
The headers for the current running kernel were not found 是不是这个原因啊?怎么解决。

- xwp911
- 帖子: 137
- 注册时间: 2013-01-13 21:26
- 系统: ubuntu14.04
Re: ubuntu主机,xubuntu虚拟机,虚拟机共享主机文件夹失败
我换了一个目录,还是这样不行。
xwp@xwp-VirtualBox:~$ sudo mount -t vboxsf vt ds1
[sudo] password for xwp:
mount:文件系统类型错误、选项错误、vt 有坏超级块,
缺少代码页或助手程序,或其他错误
(对某些文件系统(如 nfs、cifs) 您可能需要
一款 /sbin/mount.<类型> 助手程序)
有些情况下在 syslog 中可以找到一些有用信息- 请尝试
dmesg | tail 这样的命令看看。
xwp@xwp-VirtualBox:~$ dmesg |tail
[ 28.607783] type=1400 audit(1407298595.125:20): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/bin/evince" pid=735 comm="apparmor_parser"
[ 37.128434] audit_printk_skb: 75 callbacks suppressed
[ 37.128444] type=1400 audit(1407298603.645:46): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/sbin/cups-browsed" pid=1097 comm="apparmor_parser"
[ 39.805952] init: plymouth-upstart-bridge main process (157) killed by TERM signal
[ 50.085507] vboxsf: Successfully loaded version 4.3.10 (interface 0x00010004)
[ 51.389418] init: plymouth-stop pre-start process (1449) terminated with status 1
[ 51.809543] type=1400 audit(1407298620.004:47): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/lib/cups/backend/cups-pdf" pid=1462 comm="apparmor_parser"
[ 51.809598] type=1400 audit(1407298620.004:48): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/sbin/cupsd" pid=1462 comm="apparmor_parser"
[ 51.810435] type=1400 audit(1407298620.004:49): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/sbin/cupsd" pid=1462 comm="apparmor_parser"
[ 172.562067] sf_read_super_aux err=-22
xwp@xwp-VirtualBox:~$
xwp@xwp-VirtualBox:~$ sudo mount -t vboxsf vt ds1
[sudo] password for xwp:
mount:文件系统类型错误、选项错误、vt 有坏超级块,
缺少代码页或助手程序,或其他错误
(对某些文件系统(如 nfs、cifs) 您可能需要
一款 /sbin/mount.<类型> 助手程序)
有些情况下在 syslog 中可以找到一些有用信息- 请尝试
dmesg | tail 这样的命令看看。
xwp@xwp-VirtualBox:~$ dmesg |tail
[ 28.607783] type=1400 audit(1407298595.125:20): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/bin/evince" pid=735 comm="apparmor_parser"
[ 37.128434] audit_printk_skb: 75 callbacks suppressed
[ 37.128444] type=1400 audit(1407298603.645:46): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/sbin/cups-browsed" pid=1097 comm="apparmor_parser"
[ 39.805952] init: plymouth-upstart-bridge main process (157) killed by TERM signal
[ 50.085507] vboxsf: Successfully loaded version 4.3.10 (interface 0x00010004)
[ 51.389418] init: plymouth-stop pre-start process (1449) terminated with status 1
[ 51.809543] type=1400 audit(1407298620.004:47): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/lib/cups/backend/cups-pdf" pid=1462 comm="apparmor_parser"
[ 51.809598] type=1400 audit(1407298620.004:48): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/sbin/cupsd" pid=1462 comm="apparmor_parser"
[ 51.810435] type=1400 audit(1407298620.004:49): apparmor="STATUS" operation="profile_replace" profile="unconfined" name="/usr/sbin/cupsd" pid=1462 comm="apparmor_parser"
[ 172.562067] sf_read_super_aux err=-22
xwp@xwp-VirtualBox:~$
- xwp911
- 帖子: 137
- 注册时间: 2013-01-13 21:26
- 系统: ubuntu14.04
Re: ubuntu主机,xubuntu虚拟机,虚拟机共享主机文件夹失败
我在/usr/share/virtualbox/中没有发现VBoxGuestAdditions.isopoloshiao 写了: 2. 當你安裝 Virtualbox 的 時候 就會同時安裝同一個版本的 Guest Addition 的 ISO 在
/usr/share/virtualbox/VBoxGuestAdditions.iso
是否是在别的文件夹下呢?