顯示具有 virtualbox 標籤的文章。 顯示所有文章
顯示具有 virtualbox 標籤的文章。 顯示所有文章

2014年3月14日 星期五

shared_folder_centos_virtualbox

src:
https://gist.github.com/larsar/1687725

notes:


------

shared_folder_centos_virtualbox.txt
123456789101112131415161718192021222324252627282930
# The VirtualBox documentation[1] for how to install guest additions
# for Linux on a virtual host is somewhat messy. So here is what
# I did to make it work.
# Install the packages required
yum update
yum install gcc kernel-devel make
reboot
# Click: Devices/Install Guest Additions...
# Mount the ISO image with the guest additions
mkdir /cdrom
mount /dev/cdrom /cdrom
# Install guest additions
/cdrom/VBoxLinuxAdditions.run
# Share a folder from the VirtualBox control panel, giving it a share name.
ls /media/sf_<share_name>
# You could always mount the directory yourself as well
mkdir /a_folder_name
mount -t vboxsf the_share_name /a_folder_name
[1] http://www.virtualbox.org/manual/ch04.html

I'm running a fresh installation of CentOS 6 and running ./VBoxLinuxAdditions.run fails at:
Building the main Guest Additions module [FAILED]
Also, clicking Devices/Install Guest Additions apparently has no effect. The shared folder does not appear in /dev or /media
Any ideas?

@aderowbotham, make sure you update.
I ignored the part about the update since I did so a few days earlier and within that time span there was a kernel-update so I got headers for a different kernel and received the same error as you. Updating, then compiling the additions worked for me.

Sorry this might be a bit of a lame question but which ISO should i mount after installing guest additions?

Thanks! That worked like a charm!

Great Tutorial

@TravisPaul, update works for me, but can you brief why a updating is necessary?
 Please sign in to comment on this gist.

virtualbox命令行共享CentOS目錄

src:
http://www.010cnc.net/subject/about/virtualbox%E5%91%BD%E4%BB%A4%E8%A1%8C%E5%85%B1%E4%BA%ABCentOS%E7%B4%A2%E5%BC%95.html

notes:
14'3/14:
mount add to /etc/fstab


---------------
virtualbox命令行共享CentOS目錄
1. 安裝virtualbox增強工具
"右ctrl+c" 顯示和隱藏virtualbox虛擬機的菜單欄。
在VirtualBox的菜單里選擇"設備(Devices)" -> "安裝增強功能包(Install Guest Additions)"
創建掛載目錄: mkdir /mnt/zengqiang
掛載:mount /dev/cdrom /mnt/zengqiang
cd /mnt/zenqiang
./VBoxLinuxAdditions.run    #安裝增強包 
或用如下命令安裝
/etc/init.d/vboxadd setup   #安裝增強包   
2. 設置共享文件夾
完成後點擊"設備(Devices)" -> 共享文件夾(Shared Folders)菜單,添加一個共享文件夾,選項固定和臨時是指該文件夾是否是持久的。共享名可以隨意取,如"yongfu",盡量使用英文名稱,不要有空格。
3. 掛載共享文件夾
在命令行終端下輸入:
mkdir /mnt/yongfu
mount -t vboxsf yongfu /mnt/yongfu
其中"yongfu"是之前創建的共享文件夾的名字。現在虛擬機和主機可以互傳文件了。
如不想每次都手動掛載,可以在/etc/fstab中添加一項
yongfu /mnt/yongfu vboxsf rw,gid=100,uid=1000,auto 0 0
這樣就能夠自動掛載了。
4. 卸載的話使用下面的命令:
umount -f /mnt/yongfu
Bookmark the permalink ,來源:互聯網
One thought on “virtualbox命令行共享CentOS索引