Sbin mount vboxsf mounting failed with the error invalid argument

I'm trying to share a folder between ,a host, windows 10 and ,a guest, ubuntu 16.04. I have already created a folder in linux and set up inside the virtual box. Inside /media I have created a folder

I’m trying to share a folder between ,a host, windows 10 and ,a guest, ubuntu 16.04.
I have already created a folder in linux and set up inside the virtual box.
Inside /media I have created a folder called songs.
now I’m trying to mount a volume using the following:

sudo mount -t vboxsf sf_shareubuntu/ songs/

I’m getting the following error:

/sbin/mount.vboxsf: mounting failed with the error: Invalid argument

how do I solve this error?

asked Dec 30, 2018 at 2:06

Sophia B.A.'s user avatar

2

The normal way to get that done from the link provided by Norbert

sudo mount -t vboxsf [-o OPTIONS] sharename mountpoint

So your command should be

sudo mount -t vboxsf [-o OPTIONS] sharename /media/songs

To mount a shared folder during boot, add the following entry to /etc/fstab:

sharename   /media/songs   vboxsf   defaults  0   0

The sharename comes from the Windows hosts’ sharename

answered Dec 30, 2018 at 12:02

George Udosen's user avatar

George UdosenGeorge Udosen

35k12 gold badges97 silver badges119 bronze badges

2
The normal way to get that done from the link provided by Norbert
sudo mount -t vboxsf [-o OPTIONS] sharename mountpoint
So your command should be
sudo mount -t vboxsf [-o OPTIONS] sharename /media/songs

Unfortunately, this is not resolve, look:

sudo mount -t vboxsf INSTALL /media/sf_INSTALL
/sbin/mount.vboxsf: mounting failed with the error: Invalid argument

This happens when vbox-guest-utils version inside virtualbox is different from host version. Sharename isn’t properly ported between the host system and the virtualbox system.

answered Sep 29, 2022 at 10:56

Tiger's user avatar

TigerTiger

111 bronze badge

1

I got such error in guest, when I tried to mount shared folder, pointing to symbolic link on the host. Solved it by changing it to actual target folder on host instead.

answered Oct 17, 2022 at 14:01

valdisvi's user avatar

  • Reply with quote

[SOLVED] : mount.vboxsf: mounting failed……

….with the error : protocol error.

I’m running Fedora 15 as guest on a Vista host. I have shared the folder e:downloadsLinux, in the VirtualBox shared folders dialog I have shared this as LinuxDownloads.

Now, when I try to mount this share using sudo mount -t vboxsf /LinuxDownloads /home/andrew/Downloads I get the error:

mount.vboxsf: mounting failed with the error: Protocol error

If I then try sudo mount -t vboxsf LinuxDownloads /home/andrew/Downloads I get the following:

/sbin/mount.vboxsf: mounting failed with the error: Invalid argument

I want eventually to auto mount the share using rc.local but until I can manually mount the share this wont be possible.

I have seen various similar posts here but nothing seems to help. The guest additions installed OK after doing the following:

sudo yum update kernel
sudo yum install kernel-devel kernel-headers
sudo yum install gcc

I’m at a complete loss as to what to do next.

Last edited by TrotskyIcepick on 27. Jun 2011, 15:52, edited 1 time in total.

TrotskyIcepick
 
Posts: 18
Joined: 30. Apr 2010, 22:18
Primary OS: MS Windows Vista
VBox Version: OSE other
Guest OSses: Ubuntu 10.04

  • Reply with quote

Re: mount.vboxsf: mounting failed with the error: Protocol error

Postby Perryg » 27. Jun 2011, 02:02

What version of VirtualBox?
Have you rebooted?
did you tell VBox to auto-mount the share?

Perryg
Site Moderator
 
Posts: 34373
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

  • Reply with quote

Re: mount.vboxsf: mounting failed with the error: Protocol error

Postby TrotskyIcepick » 27. Jun 2011, 02:25

Hi Perry, thanks for responding.

My VirtualBox version is v4.0.8, and no I haven’t told VB to auto-mount the share (though it does work when selected, I don’t want to mount it to /media/sf_LinuxDownloads, so I turned it off).

I have rebooted several times.

I think this must be something peculiar to Fedora 15 as I previously had an installation of Ubuntu and that worked fine using the same command.

TrotskyIcepick
 
Posts: 18
Joined: 30. Apr 2010, 22:18
Primary OS: MS Windows Vista
VBox Version: OSE other
Guest OSses: Ubuntu 10.04

  • Reply with quote

Re: mount.vboxsf: mounting failed with the error: Protocol error

Postby Perryg » 27. Jun 2011, 03:09

Turning it off does not always release it for some reason. delete the share and try again.

Perryg
Site Moderator
 
Posts: 34373
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

  • Reply with quote

Re: mount.vboxsf: mounting failed with the error: Protocol error

Postby TrotskyIcepick » 27. Jun 2011, 03:36

Unfortunately that made no difference. When VirtualBox auto-mounts the shared folder, how is it doing it? It would seem I need a different command to do it?

TrotskyIcepick
 
Posts: 18
Joined: 30. Apr 2010, 22:18
Primary OS: MS Windows Vista
VBox Version: OSE other
Guest OSses: Ubuntu 10.04

  • Reply with quote

Re: mount.vboxsf: mounting failed with the error: Protocol error

Postby Perryg » 27. Jun 2011, 14:04

Auto-mount adds the share in media as a type of drive (like a CD). If you look you will see a new group in the guest called vboxsf which you would need to add the guests users login name to. As for the reason you are having issues with the manual mount, I don’t know the reason. The only things that I have seen cause this are missing guest additions or trying to manual mount a share that was set to auto-mount.

Perryg
Site Moderator
 
Posts: 34373
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

  • Reply with quote

Re: mount.vboxsf: mounting failed with the error: Protocol error

Postby TrotskyIcepick » 27. Jun 2011, 14:13

Drat :roll: The user is already a member of the vboxsf group so that shouldn’t be the issue, and guest adds were installed without a hitch. Guess I’ll need to do some trolling around the net/forums.

As far as other things I require are concerned such as the ability to manage MySQL on the guest from the host, this has been a cinch requiring some iptables and firewall configs, but works just great which is an indicator that the guest adds are working as advertised.

Will let you know how I get on.

Thanks

TrotskyIcepick
 
Posts: 18
Joined: 30. Apr 2010, 22:18
Primary OS: MS Windows Vista
VBox Version: OSE other
Guest OSses: Ubuntu 10.04

  • Reply with quote

Re: mount.vboxsf: mounting failed with the error: Protocol error

Postby TrotskyIcepick » 27. Jun 2011, 15:51

Found this post

http://ubuntuforums.org/archive/index.p … 06818.html

didn’t quite understand a lot of it but for the hell of it decided (without much hope) to try the last poster’s suggestion. Therefore I added the following to my fstab file:

LinuxDownloads /home/andrew/Downloads vboxsf rw,uid=1000,gid=1000 0 0

Low and behold, it worked a charm. I still got errors when trying a manual mount, but since auto-mount was what I needed I don’t have to worry about that.

Thanks Perry for your input.

TrotskyIcepick
 
Posts: 18
Joined: 30. Apr 2010, 22:18
Primary OS: MS Windows Vista
VBox Version: OSE other
Guest OSses: Ubuntu 10.04


Return to Linux Guests

Who is online

Users browsing this forum: SJHK, YaCy [Bot] and 8 guests

Содержание

  1. virtualbox.org
  2. [SOLVED] : mount.vboxsf: mounting failed.
  3. [SOLVED] : mount.vboxsf: mounting failed.
  4. Re: mount.vboxsf: mounting failed with the error: Protocol error
  5. Re: mount.vboxsf: mounting failed with the error: Protocol error
  6. Re: mount.vboxsf: mounting failed with the error: Protocol error
  7. Re: mount.vboxsf: mounting failed with the error: Protocol error
  8. Re: mount.vboxsf: mounting failed with the error: Protocol error
  9. Re: mount.vboxsf: mounting failed with the error: Protocol error
  10. Re: mount.vboxsf: mounting failed with the error: Protocol error
  11. Arch Linux
  12. #1 2021-08-08 16:01:53
  13. VirtualBox Arch host, any guest with shared folder
  14. #2 2021-08-09 15:57:54
  15. Re: VirtualBox Arch host, any guest with shared folder
  16. #3 2021-08-09 16:25:22
  17. Re: VirtualBox Arch host, any guest with shared folder
  18. #4 2021-08-10 11:34:39
  19. Re: VirtualBox Arch host, any guest with shared folder
  20. #5 2021-08-10 11:57:41
  21. Re: VirtualBox Arch host, any guest with shared folder
  22. #6 2021-08-10 13:14:39
  23. Re: VirtualBox Arch host, any guest with shared folder
  24. #7 2021-08-13 13:00:47
  25. Re: VirtualBox Arch host, any guest with shared folder
  26. #8 2021-08-15 18:34:16
  27. Re: VirtualBox Arch host, any guest with shared folder
  28. aboutubuntu.ru
  29. Подпишитесь на RSS
  30. VDS с Ubuntu Server
  31. Вход в систему
  32. Ubuntu 10.04 LTS
  33. Наши посетители
  34. Подпишитесь на комментарии
  35. Поиск
  36. Настройка виртуальной машины VirtualBox с гостевой Ubuntu
  37. Mounting shared folder in VirtualBox 6.1 for Ubuntu 20.04 (Windows host) not working

virtualbox.org

End user forums for VirtualBox

  • Board indexGuest systemsLinux Guests
  • Change font size
  • Print view
  • FAQ
  • Login

[SOLVED] : mount.vboxsf: mounting failed.

[SOLVED] : mount.vboxsf: mounting failed.

by TrotskyIcepick » 26. Jun 2011, 22:32

. with the error : protocol error.

I’m running Fedora 15 as guest on a Vista host. I have shared the folder e:downloadsLinux, in the VirtualBox shared folders dialog I have shared this as LinuxDownloads.

Now, when I try to mount this share using sudo mount -t vboxsf /LinuxDownloads /home/andrew/Downloads I get the error:

mount.vboxsf: mounting failed with the error: Protocol error

If I then try sudo mount -t vboxsf LinuxDownloads /home/andrew/Downloads I get the following:

/sbin/mount.vboxsf: mounting failed with the error: Invalid argument

I want eventually to auto mount the share using rc.local but until I can manually mount the share this wont be possible.

I have seen various similar posts here but nothing seems to help. The guest additions installed OK after doing the following:

sudo yum update kernel
sudo yum install kernel-devel kernel-headers
sudo yum install gcc

I’m at a complete loss as to what to do next.

Re: mount.vboxsf: mounting failed with the error: Protocol error

by Perryg » 27. Jun 2011, 02:02

Re: mount.vboxsf: mounting failed with the error: Protocol error

by TrotskyIcepick » 27. Jun 2011, 02:25

Hi Perry, thanks for responding.

My VirtualBox version is v4.0.8, and no I haven’t told VB to auto-mount the share (though it does work when selected, I don’t want to mount it to /media/sf_LinuxDownloads, so I turned it off).

I have rebooted several times.

I think this must be something peculiar to Fedora 15 as I previously had an installation of Ubuntu and that worked fine using the same command.

Re: mount.vboxsf: mounting failed with the error: Protocol error

by Perryg » 27. Jun 2011, 03:09

Re: mount.vboxsf: mounting failed with the error: Protocol error

by TrotskyIcepick » 27. Jun 2011, 03:36

Re: mount.vboxsf: mounting failed with the error: Protocol error

by Perryg » 27. Jun 2011, 14:04

Re: mount.vboxsf: mounting failed with the error: Protocol error

by TrotskyIcepick » 27. Jun 2011, 14:13

Drat The user is already a member of the vboxsf group so that shouldn’t be the issue, and guest adds were installed without a hitch. Guess I’ll need to do some trolling around the net/forums.

As far as other things I require are concerned such as the ability to manage MySQL on the guest from the host, this has been a cinch requiring some iptables and firewall configs, but works just great which is an indicator that the guest adds are working as advertised.

Will let you know how I get on.

Re: mount.vboxsf: mounting failed with the error: Protocol error

by TrotskyIcepick » 27. Jun 2011, 15:51

Found this post http://ubuntuforums.org/archive/index.p . 06818.html didn’t quite understand a lot of it but for the hell of it decided (without much hope) to try the last poster’s suggestion. Therefore I added the following to my fstab file:

LinuxDownloads /home/andrew/Downloads vboxsf rw,uid=1000,gid=1000 0 0

Low and behold, it worked a charm. I still got errors when trying a manual mount, but since auto-mount was what I needed I don’t have to worry about that.

Источник

Arch Linux

You are not logged in.

#1 2021-08-08 16:01:53

VirtualBox Arch host, any guest with shared folder

Unlike this topic where Archlinux is guest. I am running Arch linux as host. With the host modules installed by `virtualbox-host-modules-arch`:

However, while trying a recent Vagrantfile, I ran into this issue. At first I was blaming the alpine312 image, and I was trying to correct the vbox modules in there.

But that didn’t seem to help. Upon trying another Vagrantfile. I am getting the same problem:

But no solution.

Last edited by thoth (2021-08-08 16:13:49)

#2 2021-08-09 15:57:54

Re: VirtualBox Arch host, any guest with shared folder

Do the versions of virtualbox-host-modules-arch (host) and virtualbox-guest-modules-virt on the guest match ?

Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

(A works at time B) && (time C > time B ) ≠ (A works at time C)

#3 2021-08-09 16:25:22

Re: VirtualBox Arch host, any guest with shared folder

Does mounting work in a regular VM (not running through Vagrant)? If not, where is the folder you’d like to share located? I seem to recall that there was an issue sharing a folder that lives on a symlinked path.

#4 2021-08-10 11:34:39

Re: VirtualBox Arch host, any guest with shared folder

Ok starting with a fresh ubuntu bionic beaver install by hand (no vagrant), I insert the guest additions:

run it, poweroff, create a shared directory (named shared), and reboot

Which is the same output I get with the mount command in the vagrant boxes.

#5 2021-08-10 11:57:41

Re: VirtualBox Arch host, any guest with shared folder

The standard form of the mount command is:

mount -t type device dir

I kinda doubt the guest knows how to access a device called shared .

Please post /etc/fstab and the output of lsblk -f (both from the pov of the guest) .

Last edited by Lone_Wolf (2021-08-10 11:58:09)

Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

(A works at time B) && (time C > time B ) ≠ (A works at time C)

#6 2021-08-10 13:14:39

Re: VirtualBox Arch host, any guest with shared folder

That’s how I felt about the device name, but that is indeed how vagrant is reporting it as well. But I am uncertain how the vboxsf device is supposed to look? Can you post what it looks like in a working state?

# lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
sda
└─sda1 ext4 7287a8c3-630b-4c1e-9d32-087000bc2603 /
sr0 iso9660 VBox_GAs_6.1.26 2021-07-28-16-34-25-54

# fdisk -l
Disk /dev/sda: 8 GiB, 8589934592 bytes, 16777216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xdd9f9a06

Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 16775167 16773120 8G 83 Linux

# blkid
/dev/sr0: UUID=»2021-07-28-16-34-25-54″ LABEL=»VBox_GAs_6.1.26″ TYPE=»iso9660″
/dev/sda1: UUID=»7287a8c3-630b-4c1e-9d32-087000bc2603″ TYPE=»ext4″ PARTUUID=»dd9f9a06-01″
«`

I have also tried with ‘automount’ on in vbox settings, same results.

Last edited by thoth (2021-08-10 13:19:43)

#7 2021-08-13 13:00:47

Re: VirtualBox Arch host, any guest with shared folder

Personally I use qemu from CLI and if/when I need to share something between guest and host I use ftp or scp/sftp , not hypervisor dependent methods.

I’ve read up on VBox shared folders and they do indeed use the folder name on the host as default for the device on the guest .

Perhaps you could try installing an archlinux guest using https://wiki.archlinux.org/title/Virtua … as_a_guest to verify everything works as intended ?

Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

(A works at time B) && (time C > time B ) ≠ (A works at time C)

#8 2021-08-15 18:34:16

Re: VirtualBox Arch host, any guest with shared folder

Ya, I’m a fan of QEMU/KVM as well, my homelab is entirely based on it.

But I still need to test some of these Vagrant boxes out on VirtualBox as that was what the original author built them in and Vagrant does not support KVM in the same way as VirtualBox and just changing provider in vagrant has a host of other issues I’d rather not deal with.

Источник

aboutubuntu.ru

VDS с Ubuntu Server

Мы работаем на виртуальном выделенном сервере от TrueVDS с Ubuntu на борту. Всем довольны и другим рекомендуем.

Вход в систему

Ubuntu 10.04 LTS

Наши посетители

Подпишитесь на комментарии

RSS всех комментариев:

Поиск

А вот зарегистрированные пользователи не утруждают себя просмотром рекламной информации на этом сайте.

Настройка виртуальной машины VirtualBox с гостевой Ubuntu

Виртуализация полезна во многих случаях: за несколько часов вы можете установить несколько разных дистрибутивов Linux на виртуальных машинах и связать всё это хозяйство их в локальную сеть при этом оставаясь в Windows. На практике же я уже несколько раз встречался с такой ситуацией: расставаться с привычной Windows человек не готов, а на Linux хочет посмотреть поближе (не на уровне LiveCD, а в процессе регулярного использования). Ну, или Windows может «требоваться» для игр (в виртуальную машину игровую систему не отправишь — современные игры к ресурсам требовательны весьма и не простят потерю производительности). Компания Sun бесплатно распространяет (предлагая и открытые версии для стандартных ОС) систему виртуализации VirtualBox. Решение не самое производительное, но, думаю, самое дружелюбное к пользователю. А потому рассказ о том, как установить VirtualBox на Windows-хост читайте на оф. сайте или ищите в любимом поисковике — материалов на русском реально много.

Я же дальше расскажу о том, как максимально быстро обжиться в виртуальной системе.

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

Для начала обновите систему до актуального состояния. Я могу ошибаться, но, похоже, если у вас появляются какие-то обновления ядра, вам требуется устанавливать дополнения для гостевой ОС повторно. Я с этим столкнулся. Но не отметил что именно обновлялось, поэтому просто делюсь наблюдением.

В главном меню окна виртуальной машины выбрать: «Устройства» > «Установить дополнения гостевой ОС». После чего в вашей остевой ОС (в данном случае в Ubuntu) появится новый оптический диск с названными дополнениями. Диск попытается автозапуститься, но поможет это не слишком: для установки дополнений всё равно нужны привилегии суперпользователя. Поэтому предложение об автозапуске можно предлагаю проигнорировать, а отправиться в консоль и выполнить там следующую команду:

После того, как дополнения установятся, гостевую систему нужно перезагрузить. Чтоб далеко за мышкой не ходить, можно сделать это прямо из консоли:

sudo shutdown -r now

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

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

Сначала приготовим хост. В главном меню окна виртуальной машины выбрать: «Устройства» > «Общие папки». В появившемся окоше нажмите Insert на клавиатуре, чтобы увидеть диалог создания новой папки. Путь к папке выберите сами, в зависимости от того хотите ли вы создать для целей обмена файлами новую папку или показать гостевой системе какую-то существующую. Имя папки нам потребуется в процессе дальнейших настроек, пускай будет VirtualBoxShare. Сделать ли папку постоянной (постоянная папка будет доступна и после перезапуска всей системы виртуализации) и разрешить гостевой ОС запись в папку — решайте сами (и своё решение сообщайте с помощью соответствующих чекбоксов).

После того, как общая папка будет создана, её можно монтировать в гостевой ОС.

Создадим точку монтирования:

sudo mkdir /media/share

Разрешим записывать в папку всем пользователям виртуальной ОС (тут, опять же, решайте сами, кому в вашем случае требуются такие права):

sudo chmod 777 /media/share

И теперь, собственно, монтируем:

sudo mount -t vboxsf VirtualBoxShare /media/share

Готово. Можете отправляться в примонтированную директорию ( cd /media/share ) и убедиться, что всё её содержимое, доступное из реальной ОС, теперь имеется и в гостевой ( ls -al /media/share ).

Не совсем удобно каждый раз после запуска виртуальной машины монтировать в ней общую папку. На постоянной основе проблема решается добавлением записи в /etc/fstab :

sudo echo VirtualBoxShare /media/share vboxsf defaults 0 0 >> /etc/fstab

Плодотворной вам виртуализации.

А наши спонсоры с сайта с очень звучным названием рекомендуют не обращать внимания на финансовый кризис.

Источник

I followed https://www.pragmaticlinux.com/2021/02/how-to-mount-a-shared-folder-in-virtualbox/(among other related threads) in order to mount a shared folder in my Ubuntu 20.04 VM.

Auto-mounting

I created an entry under VirtualBox Ubuntu 20.04 VM Settings -> Shared Folders and completed the Folder Path to a valid Windows(host) location, the Folder Name (called shared) and checked Auto-mount and Make Permanent. I left Mount point empty.

After the above setup I boot the Ubuntu 20 VM and I was expecting to see the mount under /media/sf_shared and I did see it however it was empty even though on the host machine there are several files.

Manual mounting

From VirtualBox In Settings -> Shared Folders dialog I unchecked Auto-mount checkbox and added a valid value in Mount point (eg. /home/myuser/shared ). However the same behavior as for Auto-mounting happens. The share does not work, cannot see the files under the shared folder from the host machine.

From VM Ubuntu terminal

sudo mount -t vboxsf -o uid=$USER,gid=vboxsf shared /home/myuser/shared

But I get the following error:

/sbin/mount.vboxsf: mounting failed with the error: Invalid argument

Maybe the last error that I got in terminal is a hint for the root of the problem. However I couldn’t find any relevant information of how to solve it. Does anyone has any idea of what’s going on here?

Also must mention that on the same VirtualBox I have another VM installed (Ubuntu 18.04) on which the auto-mounting is working as a charm.

Источник

Виртуализация полезна во многих случаях: за несколько часов вы можете установить несколько разных дистрибутивов Linux на виртуальных машинах и связать всё это хозяйство их в локальную сеть при этом оставаясь в Windows. На практике же я уже несколько раз встречался с такой ситуацией: расставаться с привычной Windows человек не готов, а на Linux хочет посмотреть поближе (не на уровне LiveCD, а в процессе регулярного использования). Ну, или Windows может «требоваться» для игр (в виртуальную машину игровую систему не отправишь — современные игры к ресурсам требовательны весьма и не простят потерю производительности). Компания Sun бесплатно распространяет (предлагая и открытые версии для стандартных ОС) систему виртуализации VirtualBox. Решение не самое производительное, но, думаю, самое дружелюбное к пользователю. А потому рассказ о том, как установить VirtualBox на Windows-хост читайте на оф. сайте или ищите в любимом поисковике — материалов на русском реально много.

Я же дальше расскажу о том, как максимально быстро обжиться в виртуальной системе.

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

Для начала обновите систему до актуального состояния. Я могу ошибаться, но, похоже, если у вас появляются какие-то обновления ядра, вам требуется устанавливать дополнения для гостевой ОС повторно. Я с этим столкнулся. Но не отметил что именно обновлялось, поэтому просто делюсь наблюдением.

В главном меню окна виртуальной машины выбрать: «Устройства» > «Установить дополнения гостевой ОС». После чего в вашей остевой ОС (в данном случае в Ubuntu) появится новый оптический диск с названными дополнениями. Диск попытается автозапуститься, но поможет это не слишком: для установки дополнений всё равно нужны привилегии суперпользователя. Поэтому предложение об автозапуске можно предлагаю проигнорировать, а отправиться в консоль и выполнить там следующую команду:

sudo /media/cdrom/VBoxLinuxAdditions-x86.run

После того, как дополнения установятся, гостевую систему нужно перезагрузить. Чтоб далеко за мышкой не ходить, можно сделать это прямо из консоли:

sudo shutdown -r now

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

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

Сначала приготовим хост. В главном меню окна виртуальной машины выбрать: «Устройства» > «Общие папки». В появившемся окоше нажмите Insert на клавиатуре, чтобы увидеть диалог создания новой папки. Путь к папке выберите сами, в зависимости от того хотите ли вы создать для целей обмена файлами новую папку или показать гостевой системе какую-то существующую. Имя папки нам потребуется в процессе дальнейших настроек, пускай будет VirtualBoxShare. Сделать ли папку постоянной (постоянная папка будет доступна и после перезапуска всей системы виртуализации) и разрешить гостевой ОС запись в папку — решайте сами (и своё решение сообщайте с помощью соответствующих чекбоксов).

После того, как общая папка будет создана, её можно монтировать в гостевой ОС.

Создадим точку монтирования:

sudo mkdir /media/share

Разрешим записывать в папку всем пользователям виртуальной ОС (тут, опять же, решайте сами, кому в вашем случае требуются такие права):

sudo chmod 777 /media/share

И теперь, собственно, монтируем:

sudo mount -t vboxsf VirtualBoxShare /media/share

Готово. Можете отправляться в примонтированную директорию (cd /media/share) и убедиться, что всё её содержимое, доступное из реальной ОС, теперь имеется и в гостевой (ls -al /media/share).

Не совсем удобно каждый раз после запуска виртуальной машины монтировать в ней общую папку. На постоянной основе проблема решается добавлением записи в /etc/fstab:

sudo echo VirtualBoxShare /media/share vboxsf defaults 0 0 >> /etc/fstab

Плодотворной вам виртуализации.

А наши спонсоры с сайта с очень звучным названием рекомендуют не обращать внимания на финансовый кризис.

@estorgio thank you for your article been using your help, anyway why not use the article as tree branch? so just select branch version 16.04 or 18.04, it will help a lot and also it will be good if the url for this article is clear not hash

@rsyqvthv okay i got it, for those in need for special chmod and chown,

in /etc/fstab
shared /home/<username>/shared vboxsf rw,exec,uid=<youruserid>,gid=<yourusergroupid>,dmode=755,fmode=644 0 0
example :
modul /odoo/custom/addons vboxsf rw,exec,uid=112,gid=115,dmode=755,fmode=644 0 0
dmode = directory mode
fmode = file mode

after that as usual shutdown -r now

if you check stat /home/<username>/shared it will show you the right ownership with your custom user and group also this apply to the folder and also child files or folders

how to find your user id and your group id or user group id, check this: https://kb.iu.edu/d/adwf (i’m lazy to write it LoL)

Note 1:
auto-mount and make permanent doesn’t work using multi folder setting, just tested and only work on Transient folder (or maybe I just don’t know how to use ‘mount points’) anyway i just don’t thick those two and multi folder sharing worked fine

Write multi line for multi Shared Folders:

modul11	/odoo11/custom/addons	vboxsf	rw,exec,uid=112,gid=115,dmode=755,fmode=644	0	0
modul12	/odoo12/custom/addons	vboxsf	rw,exec,uid=113,gid=116,dmode=755,fmode=644	0	0

i’m using multiple odoo version and it must have their own user:group (defaults, you can customized it, but better leave it as is)
so i need
user name odoo
group name odoo
or at least for best practice not root:root

Note 2:
again something is not right,
virtual box: Version 6.1.6 r137129 (Qt5.6.2)
host: windows 10
guest: ubuntu 18.04.4
if you edit Shared Folder settings while the terminal is on, for some unknown reason the saved path of Transient Folders is gone when you power down terminal (never happen on latest v5.x and v6.0 vbox).
so have to save while terminal is off and you can tick the auto mount option to use Machine Folders mode

Понравилась статья? Поделить с друзьями:
  • Sberpay ошибка при оплате
  • Sbds interactive codes ошибка
  • Sbc 120 ошибка f03
  • Saving error тильда
  • Saving changes is not permitted sql server ошибка