標籤:style blog http color io os 使用 ar 檔案
今天在要實現centos(在virtualbox中)和windows實現共用資料夾的過程中遇到諸多錯誤,費了一下午時間來搞這個,首先配置共用資料夾的方法就不介紹了,這裡面介紹的是在配置的過程中遇到的諸多錯誤
- 在VirtualBox的菜單裡選擇“裝置”->“安裝增強功能包(Install Guest Additions)”
- 之後案頭會出現一個光碟片,在命令列裡輸入:
- 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久之後終於起效,哎,痛苦的一筆。
- 先是試了如下命令:
- $ sudo yum updatethen
- $ sudo yum install kernel-devel gcc
- $ echo export KERN_DIR=/usr/src/kernels/`uname -r` >> ~/.bashrc
- 然後又試了如下命令:
- yum install kernel* dkms gcc
- Then
- yum install kernel-uek-devel
- Then reboot your machine
- 之後沒有重啟,試著重新安裝增強功能包,依然錯誤,重啟之後又試了這兩個命令: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 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. |
終於看到綠色的ok了,真是太不容易了,然後繼續mount -t vboxsf linux_share /mnt/share,linux_share是在VirtualBox中設定的共用檔案名稱,/mnt/share是centos中建立的檔案夾,注意兩個檔案夾名字最後不要一樣,防止出現其他錯誤。
- 後來在測試的時候,我使用的是xshell,發現這玩意不支援中文,真是跪了,中國人太不容易了,特別是程式員,幸好在網上發現了這個,好東西啊,就要共用啊
- http://moralistxp.blog.163.com/blog/static/1161103982013112411540183/
- http://jingyan.baidu.com/article/3ea51489eca4b452e61bbaca.html
virtual box實現centos和windows共用資料夾