Astra linux vmware shared folders

Как создать общую папку в VMware Workstation

В статье мы рассмотрим, для чего нужна общая папка и как её создать в VMware Workstation.

Перед настройкой общей папки нужно создать виртуальную машину и установить на неё VMware Tools. Используйте наши инструкции, если хотите создать виртуальные машины Windows 10 или Ubuntu.

Зачем нужна общая папка

Общая папка нужна для быстрого обмена файлами между хостовой (физической) и гостевой (виртуальной) ОС.

Предположим, вам нужно установить одну из программ на виртуальную машину. При этом эта программа уже установлена на вашей физической машине. Если общей папки нет, вам придется скопировать файл программы с хостовой ОС на съемный носитель (например, флешку) а затем с носителя перенести его на гостевую ОС.

Если у вас уже настроена общая папка, достаточно поместить в неё нужный файл и программу можно будет использовать как на физической, так и на виртуальной машине. Таким образом с помощью общей папки вы сможете быстрее и удобнее обмениваться файлами между ОС. Давайте посмотрим, как создать такую папку.

Как сделать общую папку в VMware

Предварительно создайте папку в хостовой ОС. Это можно сделать в любом разделе компьютера (например, «Рабочий стол» или «Документы»).

Чтобы сделать папку общей:

общая папка 1

Откройте программу VMware Player. В библиотеке выберите нужную виртуальную машину и нажмите Edit virtual machine settings:

общая папка 2

Перейдите на вкладку Options:

общая папка 3

На вкладке «Options» кликните на строку Shared Folders. Выберите пункт Always enabled: так вы сможете работать с папкой и с хостовой, и с гостевой ОС. Затем нажмите на кнопку Add…:

общая папка 4

В появившемся окне нажмите Next:

  • Host Path — укажите путь до общей папки. Для этого нажмите Browse и выберите папку, которую хотите назначить общей;
  • Name — введите название общей папки. Укажите то же название, которое вы дали папке на локальном компьютере.

общая папка 5

Затем нажмите Next: VMware общая папка

общая папка 6

Отметьте галочкой пункт Enable this share и нажмите Finish:

общая папка 7

Чтобы сохранить изменения, нажмите OK:

Готово, вы создали общую папку.

Как открыть общую папку

Выберите инструкцию в зависимости от вашей гостевой операционной системы.

Ubuntu

В Ubuntu общая папка находится в каталоге hgfs. Полный путь до этого каталога — /mnt/hgfs/.

открыть общую папку в vmware 2

Где name — имя общей папки. Строкой ниже вы увидите путь до нее — это значит, что вы попали в папку:

открыть общую папку в vmware 3

VMware Workstation общая папка

Прежде всего, проверьте, установлены ли пакеты open-vm-tools и open-vm-tools-desktop:

sudo apt install open-vm-tools open-vm-tools-desktop

Если пакеты установлены, но общая папка не видна в гостевой системе, то:

sudo vmhgfs-fuse .host: /mnt/hgfs -o allow_other -o uid=1000

где uid — идентификатор вашего пользователя в системе. Узнать идентификатор можно с помощью команды id .

Читайте также:  Шрифт linux libertine кириллица

Чтобы монтирование производилось автоматически при каждом запуске системы, откройте файл /etc/fstab:

.host: /mnt/hgfs fuse.vmhgfs-fuse defaults,allow_other,uid=1000,nonempty 0 0

общая папка 8

где uid — идентификатор вашего пользователя в системе. Узнать идентификатор можно с помощью команды id . Чтобы сохранить изменения, нажмите Ctrl+X, Y, Enter.

Windows

В гостевой ОС Windows общая папка отобразится в разделе «Проводник».

открыть общую папку в vmware 4

Откройте раздел «Проводник»:

открыть общую папку в vmware 5

Разверните блок «Сетевые расположения». Левой кнопкой мыши дважды кликните по диску «Shared Folders»: VMware Shared Folders

Готово, вы открыли общую папку.

Источник

Mounting VMware Shares from the Command Line on Linux VM

In this article, I am going to show you how to share a directory/folder to a VMware Virtual Machine (VM) and how to mount the VMware share from the command line on a Linux VMware Virtual Machine (VM). So, let’s get started.

Adding a Share to the VMware VM:

To share a directory/folder from the host to a VMware VM, open the VM, make sure the VM is not powered on and go to VM > Settings.

Then, go to the Options tab and click on Shared Folders.

By default, Shared Folders is Disabled. To enable Shared Folders, select Always enabled.

Now, you can add shared folders. To add a shared folder, click on Add…

Now, click on Next.

Now, click on Browse to select a directory/folder from your host computer.

Select a directory/folder that you want to share to the VMware VM and click on OK.

If you want to create a new directory, select a directory (parent) where you want to create a new directory, type in a Folder name and click on Make New Folder. Once the directory/folder is created, you should be able to select it for sharing.

By default, the Name of the shared folder should be the name of the directory you’ve selected. If you want, you can change it. I recommend you not to add spaces in the share Name.

Once you’re done, click on Next.

Make sure Enable this share checkbox is checked.

If you want this share to be read only, check the Read-only checkbox.

Once you’re done, click on Finish.

The share should be added to the VM.

If you want to remove a share, select it and click on Remove.

If you want to change any property of the share, select the share and click on Properties.

You can modify the Name, the Host path, share attributes from here. Once you’re done, click on OK for the changes to take effect.

Читайте также:  Linux посмотреть версии пакетов

Now, click on OK.

Now, power on the virtual machine.

The virtual machine should start.

Installing Open VM Tools:

In order to mount VMware shares on Linux, you must have Open VM Tools or VMware Tools installed on your Linux VM.

If you’re using a Ubuntu/Debian or any Ubuntu/Debian based operating system in the VMware VM, then check How to Install VMware Tools on Ubuntu/Debian VMware Virtual Machine.

Mounting VMware Shares on Linux VM:

First, make a directory (let’s say ~/testshare) on the Linux VM where you want to mount the VMware share with the following command:

The command to mount a VMware share on a Linux VM is:

To mount the VMware share testshare on the ~/testshare directory, run the following command:

The VMware share testshare should be mounted on the ~/testshare directory.

By default, the VMware shares mounted on the Linux VM is only accessible to the root user as you can see in the screenshot below. I will show you how to solve this problem. So, don’t worry.

You can unmount the VMware share mounted in the ~/testshare directory with the following command:

To allow any user on the Linux VM to access the mounted VMware share, use the allow_other mount option while mounting the VMware share.

Now, you should be able to access the mounted VMware share without sudo or superuser privileges.

But, the files and directories on the share are still owned by root.

If you want the VMware share files to be accessible to your login user and also be owned by your login user, then mount the VMware share with the uid and gid mount options as follows:

$ sudo mount -t fuse.vmhgfs-fuse -o allow_other, uid =$ ( id -u ) , gid =$ ( id -g )
.host: / testshare ~ / testshare

As you can see, the VMware share files and directories are now accessible to my login user and also owned by my login user.

Automatically Mount VMware Shares:

If you want the VMware Linux VM to automatically mount the VMware share on boot, then you have to add a new line to the /etc/fstab file.

First, open the /etc/fstab file with the following command:

You may want to use vi text editor for editing the /etc/fstab file. In that case, run the following command:

Now, add the following line at the end of the /etc/fstab file:

Note: Make sure to replace , , and .

You can find with the id -u command and with the id -g command.

In my case, I added to the following line to the /etc/fstab file:

.host: / testshare / home / shovon / testshare fuse.vmhgfs-fuse
allow_other, uid = 1000 , gid = 1000 0 0

Читайте также:  Linux all permissions chmod

Once you’re done, save the /etc/fstab file.

Now, reboot your Linux VM with the following command:

Once your Linux VM starts, run the following command to verify whether the VMware share is mounted on the Linux VM:

As you can see, the VMware share testshare is mounted correctly in the ~/testshare directory.

I can access the VMware share as usual.

So, that’s how you share a directory/folder from the host to your Linux VMware VM and mount it from the command line on your Linux VM. Thanks for reading this article.

About the author

Shahriar Shovon

Freelancer & Linux System Administrator. Also loves Web API development with Node.js and JavaScript. I was born in Bangladesh. I am currently studying Electronics and Communication Engineering at Khulna University of Engineering & Technology (KUET), one of the demanding public engineering universities of Bangladesh.

Источник

Astra linux vmware shared folders

You are using an outdated browser. Please upgrade your browser to improve your experience.

After you enable a shared folder, you can mount one or more directories or subdirectories in the shared folder to any location in the file system in addition to the default location of /mnt/hgfs .

Depending on the kernel version of the Linux guest operating system, VMware Tools uses different components to provide shared-folder functionality. In Linux kernels prior to version 4.0, the VMware Tools services script loads a driver that performs the mount. Linux kernels 4.0 and later use a FUSE file system component.

You can use different mount commands to mount all shares, one share, or a subdirectory within a share to any location in the file system. The commands also vary depending on the Linux-kernel version of the guest.

Table 1. Mount Command Syntax

Linux Kernel Prior to 4.0 Linux Kernel 4.0 and Later Description
mount -t vmhgfs .host:/ /home/user1/shares /usr/bin/vmhgfs-fuse .host:/ /home/user1/shares -o subtype=vmhgfs-fuse,allow_other Mounts all shares to /home/user1/shares
mount -t vmhgfs .host:/foo /tmp/foo /usr/bin/vmhgfs-fuse .host:/foo /tmp/foo -o subtype=vmhgfs-fuse,allow_other Mounts the share named foo to /tmp/foo
mount -t vmhgfs .host:/foo/bar /var/lib/bar /usr/bin/vmhgfs-fuse .host:/foo/bar /var/lib/bar -o subtype=vmhgfs-fuse,allow_other Mounts the subdirectory bar within the share foo to /var/lib/bar

For Linux kernel prior to version 4.0, you can use VMware-specific options in addition to the standard mount syntax. Enter the command /sbin/mount.vmhgfs -h to list the options.

For Linux kernel version 4.0 or later, enter the command /usr/bin/vmhgfs-fuse -h to list the available options.

Note: The mount can fail if shared folders are not enabled or if the share does not exist. You are not prompted to run the VMware Tools vmware-config-tools.pl configuration program again.

Источник

Оцените статью
Adblock
detector