天天看點

VirtualBox 共享設定

VirtualBox 共享設定

一、VirtualBox在winxp下虛拟ubuntu

在winxp下虛拟ubuntu,在ubuntu下通路win的共享檔案夾時出現如下錯誤:

/sbin/mount.vboxsf: mounting failed with the error: No such device

1,若要使用共享檔案夾功能,必須安裝linux guest additions,安裝增強功能,這一步得注意不然沒戲

2,lsmod | grep vboxvfs,確定加載了vboxvfs子產品,若沒有,使用sudo modprobe vboxvfs加載

3,建立一個檔案夾,sudo mkdir /home/js/dxn

4,sudo mount -t vboxsf xuni /home/js/dxn 即:sudo mount -t vboxsf “共享檔案夾名” “虛拟機共享檔案夾目錄”

5,cd /home/js/dxn

{

1)安裝VirtualBox Guest Additions的好處:

  • 滑鼠指針的整合,而不必按主機鍵(預設是右Ctrl)。
  • 剪貼闆共享,使剪切,複制和粘貼作業系統和主機之間的客戶機作業系統。
  • 任意螢幕解決方案,它可以自動調整通過調整VirtualBox的客戶視窗來賓作業系統桌面分辨率。
  • 自定義視訊驅動程式提供額外的高和不标準的視訊模式,以及視訊加速性能。
  • 客戶作業系統之間時間同步和主機。
  • 共享檔案夾在目錄中的檔案夾中的主機作為網絡共享來賓作業系統。
  • 無縫視窗地圖都在主機上的桌面桌上型電腦的虛拟機,并排顯示個别視窗。
  • 自動Windows登入。

翻譯有所精簡,保留核心步驟。很多時候不能成功安裝VirtualBox Guest

Additions,是缺少第四步驟。

版本所提Linux,即是在VirtualBox中安裝的系統。

因為各個Linux版本(如:Gnome,

KDE, Xfce, IceWM, FluxBox, etc..)的圖形安裝各有不同,是以本文将基于指令行的方式進行講解,需要使用root權限運作指令。如果使用你使用圖形使用者界面(如:Gnome), 那需要使用終端。Linux菜單目錄:“應用程式”->“附件”->“終端”。

操作步驟比較多,如果有什麼指令不能正确執行,檢視原文或使用Google找解決方案。

一、系統準備

在Linux系統安裝後,需要再安裝一些額外的軟體包。

1.Debian或基于Debian的發行版(如:Ubuntu),需要以下:

   build-essential

linux-headers-generic

Linux代碼 :

1.   

sudo apt-get install build-essential linux-headers-generic  

2.Mandriva, 需要以下:

   libgompl

   glibc-devel

   kernel-devel

   kernel-headers

urpmi gcc make libgomp1 glibc-devel kernel-devel kernel-headers

3.Fedora, Red Hat, CentOS, 需要以下:

 binutils

   gcc

  make

  patch

  libgomp

  glibc-headers

  glibc-devel

  kernel-headers

  kernel-devel

Linux代碼  

sudo yum install binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel  

 4.SUSE, 需要以下:

   kernel-source

   kernel-syms

[注意]:這裡的kernel-headers或者kernel-source需要與你的linux核心版本一緻。

二、挂載 Guest Additions

現在需要把Guest Additions的程式挂載到Linux上。VirtualBox菜單:“裝置”->"安裝增強功能",它将把Guest

Additions的ISO檔案挂載到光驅上:

三、安裝Guest Additions

打開linux的終端,進入ISO所挂載的目錄裡。

[root@integration

/]# cd /media/VBOXADDITIONS_3.0.6_52128/

VBOXADDITIONS_3.0.6_52128]# ./VBoxLinuxAdditions-amd64.run

32位的Linux,執行如下指令:

./VBoxLinuxAdditions.run  

 64位的Linux,執行如下指令:

1.    ./VboxLinuxAdditions-amd64.run   

}

二、VirtualBox在winxp下虛拟win xp

1、安裝增強功能程式

2、在虛拟機設定配置設定資料空間,如我通常設定為F:\xunixt\xuni

3、啟動虛拟機(本例為 Windows XP),點選開始菜單中的“運作”,并輸入 cmd,然後執行以下指令:

4、net use F: \\vboxsvr\dxn

   net use 共享檔案所在盤符: \\vboxsvr\共享的檔案夾名稱

5、重新啟動虛拟機,搞定!

三、VirtualBox在ubuntu8.10(host linux)下虛拟win xp

1、安裝增強功能并重新開機

2、在ubuntu8.10終端執行

   VBoxManage sharedfolder add "XP" -name "dxn" -hostpath "\home\js\dxn"

   VBoxManage sharedfolder add "VM name 指定要使用共享檔案夾的虛拟機名稱" -name "共享的檔案夾名稱" -hostpath "主機共享檔案夾所在路徑"

net use Z: \\vboxsvr\dxn

net use Z: \\vboxsvr\共享的檔案夾名稱

四、VirtualBox在ubuntu8.10(host linux)下虛拟ubuntu 這樣作有點無聊哈

根據上述舉一反三就搞定

see here

simple it is a bug

B:

Host: Win XP

Guest: Ubuntu 8.04

i want to share two folders in host to guest

but when i mount the second folder, one error occurred:

"mounting failed with the error: Protocol error"

Q:

mount the second shared folders in host to guest, it have an error:

S:

I google the error message, i found it is a bug

so, my solution is

combined the two folder in one folder, i just do one mount

it is OK

ps.

sudo mount -t vboxsf share_f32 /home/fits/xp_f32

sudo mount -t vboxsf 804 /mnt/vbox

我碰到protocal error的時候發現是本地檔案寫錯了,改了就好了。

網友評論:

1 三、VirtualBox在ubuntu8.10(host linux)下虛拟win xp