virtualbox實現centos和windows共用資料夾

來源:互聯網
上載者:User

virtualbox實現centos和windows共用資料夾
今天在要實現centos(在virtualbox中)和windows實現共用資料夾的過程中遇到諸多錯誤,費了一下午時間來搞這個,首先配置共用資料夾的方法就不介紹了,這裡面介紹的是在配置的過程中遇到的諸多錯誤
1.在VirtualBox的菜單裡選擇“裝置”->“安裝增強功能包(Install Guest Additions)”
2.之後案頭會出現一個光碟片,在命令列裡輸入:
cd /media/VBOXADDITIONS_4.3.12_93733/
然後輸入sudo ./VBoxLinuxAdditions.run
然後神奇的事情發生了,在安裝增強功能包的時候,就出現了錯誤,如下
Building the main Guest Additions module [FAILED]
(Look at /var/log/vboxadd-install.log to find out what went wrong)
思索著難道是VirtualBox版本過舊嗎?於是更新VirtualBox,依然於事無補
於是進入日誌查看發生了什麼(/var/log/vboxadd-install.log)
日誌裡面這麼寫著(Error: unable to find the sources of your current Linux kernel.Specify KERN_DIR=<directory> and run Make again)
奇怪,這個玩意居然說不知道當前的linux kernel源,在一個外文網站發現老外遇到同樣的問題,搞了n久之後終於起效,哎,痛苦的一筆。
先是試了如下命令:
1.$ sudo yum updatethen
2.$ sudo yum install kernel-devel gcc
3.$ echo export KERN_DIR=/usr/src/kernels/`uname -r` >> ~/.bashrc
4.然後又試了如下命令:
1.yum install kernel* dkms gcc
2.Then
3.yum install kernel-uek-devel
4.Then reboot your machine
5.之後沒有重啟,試著重新安裝增強功能包,依然錯誤,重啟之後又試了這兩個命令:yum install kernel* dkms gcc;yum install kernel-uek-devel,完事,安裝增強功能包: Installing additional modules ... Removing existing VirtualBox non-DKMS kernel modules [ OK ] Building the VirtualBox Guest Additions kernel modules Building 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 drivers Installing 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 restart the guest system) to enable the Guest Additions.
終於看到綠色的ok了,真是太不容易了,然後繼續mount -t vboxsf linux_share /mnt/share,linux_share是在VirtualBox中設定的共用檔案名稱,/mnt/share是centos中建立的檔案夾,注意兩個檔案夾名字最後不要一樣,防止出現其他錯誤。
6.後來在測試的時候,我使用的是xshell,發現這玩意不支援中文,真是跪了,中國人太不容易了,特別是程式員,幸好在網上發現了這個,好東西啊,就要共用啊
7.http://moralistxp.blog.163.com/blog/static/1161103982013112411540183/
8.http://jingyan.baidu.com/article/3ea51489eca4b452e61bbaca.html
9.別忙還沒完,如果你不想每次都手動載入的話,那麼假如您不想每一次都手動掛載,可以在/etc/fstab中添加一項 linux_share /mnt/share vboxsf rw,gid=100,uid=1000,auto 0 0,以後就會每次開機自動載入。已親測,可用。
10.如果想要卸載的話,使用umount -f /mnt/share,如果出現umount2: Device or resource busy
1.umount: /mnt/share: device is busy.
2.(In some cases useful info about processes that use
3.the device is found by lsof(8) or fuser(1))
4.umount2: Device or resource busy
5.說明你還沒有退出該目錄,或者掛載裝置正在使用中
6.如果有不確定的地方,可以參考http://jingyan.baidu.com/article/2fb0ba40541a5900f2ec5f07.html

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.