VirtualBox のバージョン : 4.0.6
ホストOS : Windows7 64-bit
ゲストOS : Ubuntu 11.04
1. 共有フォルダは、まずVirtualBoxの「デバイス」→「共有フォルダ」から設定。
2. この時、自動マウントしておくと、ゲストLinuxを立ち上げたときに/media/sf_○○にマウントされる。
3. Ubuntu 11.04では、右上の電源ボタンから「システム設定」を開き、「ユーザーとグループ」からvboxsfというグループに自分を参加させる。
以下、日記。
----------------
数日前にVirtualBoxをアップデートした途端に、それまで使えていたUbuntu 10.10の共有フォルダがマウントされなくなってしまった。
何度も
sudo mount.vboxsf ○○ /home/××/○○
と試してみても、
/sbin/mount.vboxsf: mounting failed with the error: Invalid argument
と怒られてしまう。
ゲストOSが壊れたのかと、10.04LTSなども使ってみたり、何度もインストールしなおしたがダメ。
ググッてみたが解決策を見つけられず、仕方なくHelpファイルを見てみると・・・
With Linux guests, auto-mounted shared folders are mounted into the /media
directory, along with the prefix sf_
. For example, the shared folder myfiles
would be mounted to /media/sf_myfiles
on Linux and /mnt/sf_myfiles
on Solaris.
The guest property /VirtualBox/GuestAdd/SharedFolders/MountPrefix
determines the prefix that is used. Change that guest property to a value other than "sf" to change that prefix; see Section 4.6, “Guest properties” for details. Note
Access to auto-mounted shared folders is only granted to the user group vboxsf
, which is created by the VirtualBox Guest Additions installer. Hence guest users have to be member of that group to have read/write access or to have read-only access in case the folder is not mapped writable.
というわけで、どうやら自動マウントにしておくと、勝手に/media/sf_○○にマウントされるらしい。
そのままではこのフォルダはvboxsfというグループに属しているので、自分をこのユーザーグループに参加させて、再起動したら、ちゃんとこの共有フォルダにアクセスできるようになった。
# それにしても、リリース直後のUbuntu 11.04を使おうという考えたために、Unityの使い方から調べ直すという愚に陥ったのは、われながらミーハーな性格が災いしているなぁと反省・・・