?
VirtualBox is a program that allows you to run multiple operating systems (guests) on one computer (the host computer). You may need to transfer files between the host and the guest. It’s easy to set up in Windows guests, but tricky in Ubuntu guests.
VirtualBox是一種程序,可讓您在一臺(tái)計(jì)算機(jī)(主機(jī))上運(yùn)行多個(gè)操作系統(tǒng)(來(lái)賓)。 您可能需要在主機(jī)和來(lái)賓之間傳輸文件。 在Windows guest虛擬機(jī)中設(shè)置起來(lái)很容易,而在Ubuntu guest虛擬機(jī)中設(shè)置起來(lái)比較麻煩。
We’ll show you how to set up an Ubuntu guest machine so you can access folders on the host machine from within the guest machine. You must enable shared folders to do this, which are available by installing VirtualBox guest additions software (see our?article?for instructions on how to do this).
我們將向您展示如何設(shè)置Ubuntu來(lái)賓計(jì)算機(jī),以便您可以從來(lái)賓計(jì)算機(jī)中訪問(wèn)主機(jī)上的文件夾。 您必須啟用共享文件夾才能執(zhí)行此操作,這可以通過(guò)安裝VirtualBox來(lái)賓添加軟件來(lái)使用(有關(guān)如何執(zhí)行此操作的說(shuō)明,請(qǐng)參閱我們的文章?)。
Once you’ve installed the guest additions, enable shared folders by adding a folder from your host machine in the settings for the guest machine. To do this, first make sure the guest machine is powered off. Then, select the guest machine in the list on the left of the VirtualBox Manager and click Settings on the toolbar.
安裝來(lái)賓添加后,通過(guò)在來(lái)賓計(jì)算機(jī)的設(shè)置中添加來(lái)自主機(jī)的文件夾來(lái)啟用共享文件夾。 為此,請(qǐng)首先確保客戶機(jī)已關(guān)閉電源。 然后,在VirtualBox Manager左側(cè)的列表中選擇客戶機(jī),然后單擊工具欄上的“設(shè)置”。
On the Settings dialog box, click Shared Folders in the list of options on the left. On the Shared Folders screen, click the folder button with the plus sign to add a folder.
?
在“設(shè)置”對(duì)話框上,單擊左側(cè)選項(xiàng)列表中的“共享文件夾”。 在“共享文件夾”屏幕上,單擊帶有加號(hào)的文件夾按鈕以添加文件夾。
On the Add Share dialog box, select Other from the Folder Path drop-down list.
在“添加共享”對(duì)話框中,從“文件夾路徑”下拉列表中選擇“其他”。
?
The Browse For Folder dialog box displays. Navigate to the folder you want to share between the host and the guest, select it, and click OK.
顯示“瀏覽文件夾”對(duì)話框。 導(dǎo)航到您要在主機(jī)和來(lái)賓之間共享的文件夾,選擇它,然后單擊“確定”。
The path to the selected folder is inserted in the Folder Path edit box. The name of the folder automatically becomes the Folder Name, but you can change this name if you want. If you don’t want to be able to change items in this folder in the guest machine, select the Read-only check box. To have the selected folder automatically mounted in the guest machine when you boot it, select the Auto-mount check box. Click OK once you’ve finished choosing your settings for the shared folder.
所選文件夾的路徑將插入“文件夾路徑”編輯框中。 文件夾的名稱將自動(dòng)變?yōu)椤拔募A名稱”,但是您可以根據(jù)需要更改此名稱。 如果您不想更改來(lái)賓計(jì)算機(jī)中此文件夾中的項(xiàng)目,請(qǐng)選中“只讀”復(fù)選框。 要在引導(dǎo)計(jì)算機(jī)時(shí)自動(dòng)將所選文件夾安裝在客戶機(jī)中,請(qǐng)選中“自動(dòng)安裝”復(fù)選框。 完成選擇共享文件夾的設(shè)置后,單擊“確定”。
The selected folder displays in the Folders List. Click OK to close the dialog box.
所選文件夾顯示在“文件夾列表”中。 單擊“確定”關(guān)閉對(duì)話框。
?
Now, make sure the guest machine is still selected in the VirtualBox Manager and click Start to boot it.
現(xiàn)在,請(qǐng)確保在VirtualBox管理器中仍選擇了客戶機(jī),然后單擊“啟動(dòng)”以啟動(dòng)它。
Once the guest machine is booted, open Nautilus (File Manager) by clicking the file cabinet on the Unity bar on the left side of the desktop.
客戶機(jī)啟動(dòng)后,通過(guò)單擊桌面左側(cè)Unity欄上的文件柜,打開Nautilus(文件管理器)。
In the Devices list on the left, click Computer and then double-click the Media folder on the right. You’ll see a folder named similarly to the folder you selected to share on your host machine with “sf_” added to the beginning of the name.
在左側(cè)的“設(shè)備”列表中,單擊“計(jì)算機(jī)”,然后雙擊右側(cè)的“媒體”文件夾。 您將看到一個(gè)與您選擇在主機(jī)上共享的文件夾類似的文件夾名稱,名稱的開頭添加了“ sf_”。
If you double-click on that folder, the following dialog box displays. This is because there is one more task to perform before you can access the shared folder.
如果雙擊該文件夾,將顯示以下對(duì)話框。 這是因?yàn)樵谠L問(wèn)共享文件夾之前,還有另外一項(xiàng)任務(wù)要執(zhí)行。
In addition to users in Ubuntu, there are also groups. When VirtualBox installed the Ubuntu operating system, it added a group called “vboxsf”. Before you can access any shared folders, you must add yourself to the vboxsf group. To do this, press Ctrl + Alt + T to open a Terminal window. Type the following at the prompt, replacing “[username]” with your username, and press Enter.
除了Ubuntu中的用戶外,還有組。 當(dāng)VirtualBox安裝Ubuntu操作系統(tǒng)時(shí),它添加了一個(gè)名為“ vboxsf”的組。 在訪問(wèn)任何共享文件夾之前,必須將自己添加到vboxsf組。 為此,請(qǐng)按Ctrl + Alt + T打開“終端”窗口。 在提示符下鍵入以下內(nèi)容,用您的用戶名替換“ [username]”,然后按Enter。
sudo adduser [username] vboxsf
sudo adduser [用戶名] vboxsf
Type your password when prompted and press Enter again. Messages display as you are being added to the group and “Done.” displays when the process has been successfully completed.
出現(xiàn)提示時(shí)輸入密碼,然后再次按Enter。 在您被添加到組和“完成”時(shí),顯示消息。 在過(guò)程成功完成時(shí)顯示。
To close the Terminal window, type “exit” (without the quotes) at the prompt and press Enter.
要關(guān)閉“終端”窗口,請(qǐng)?jiān)谔崾痉骆I入“ exit”(不帶引號(hào)),然后按Enter。
To verify you are in the vboxsf group, you can type “id [username]” (without the quotes, and replacing “[username]” with your username) at the prompt and press Enter. All the groups of which the specified user is a member display.
要驗(yàn)證您是否在vboxsf組中,可以在提示符下鍵入“ id [username]”(不帶引號(hào),并用用戶名替換“ [username]”),然后按Enter。 顯示指定用戶是其成員的所有組。
Now, when you access the shared folder in the Media folder as described above, you should see any files in that exist in that folder on the host machine.
現(xiàn)在,當(dāng)您如上所述訪問(wèn)“媒體”文件夾中的共享文件夾時(shí),您應(yīng)該看到主機(jī)上該文件夾中存在的所有文件。
You can edit these files directly in this folder if you DID NOT select the “Read-only” option when selecting the folder in the Settings. You can also copy files into and out of this folder. If the folder was set to “Read-only”, you can only copy files from this folder and cannot copy files into it.文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-497997.html
如果在“設(shè)置”中選擇文件夾時(shí)未選擇“只讀”選項(xiàng),則可以直接在此文件夾中編輯這些文件。 您也可以將文件復(fù)制到該文件夾??中以及從該文件夾中復(fù)制文件。 如果文件夾設(shè)置為“只讀”,則只能從該文件夾復(fù)制文件,而不能將文件復(fù)制到其中。文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-497997.html
到了這里,關(guān)于Orcle VM VirturalBox與Ubantu1404共享文件夾的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!