Change permissions of mounted subfolders - virtualbox

I'm using windows 7 as host and debian 6 in a VirtualBox VM. The guest additions are installed to share a folder provided by the host system.
In debian runs a webserver. So far everything is good.
But it's required to change the permissions on subfolders too. The shared folder is mounted with
mount -t vboxsf -o permissions,umask=0000,uid=33,gid=33 webdev /var/www
Is there any way to realize this?
The alternative is a samba share on the guest system, but that would be slow.

Related

Is it possible to download file or folders from AWS Linux EC2 instance to local Windows 10 machine?

I am having one Linux Ec2 instance on AWS and my local machine is Windows 10 (64-bit).
I want to download some files or folders from Ec2 to location windows machine.
I am not sure whether it is possible or not? if yes, how we can do that.
thanks.
I tried this it worked for me.
Download https://mobaxterm.mobatek.net/ its an Enhanced terminal for Windows.
You can link your EC2 instance directly via SSH its pretty simple to set up. Just follow the instuctions they've given. Once linked, its super easy to export, import, create files and folders all via mobaxterm.
folders in mobaxterm:
Got the command to Copy from Windows to Linux.
First you need to install putty (putty-64bit-0.74-installer.msi) on your windows machine
The Command is as follow it will copy the folder(e.g. DokerAutomationResult) to the windows machine from AWSLinux machine.
pscp -r ubuntu#xx.xxx.xx.xx:/home/ubuntu/DokerAutomationResult ./
[pscp -r ubuntu#(ipAddress):(locationOfLinuxFileLocation /(locationToCopyInWInodws) ]
For better Understanding:
https://www.youtube.com/watch?v=Sc0f-sxDJy0&ab_channel=Liv4IT
Yes it is possible to download files from ec2 linux instance to local system.
You can use scp -i key user#ip add:/file location which you want to download.
. will download file in your current location on local system

How does one configure shared folders to automount for arch/manjaro linux VM in virtualbox?

I have a manjaro/arch virtual machine running in virtualbox with a windows 10 host. I have configured the shared folder I want to share in virtualbox as c:\tfs with the name tfs but it doesn't show up in the linux vm anywhere. I am able to mount it manually, but it won't auto-mount. I created the /media and /media/tfs folder in the VM, since it did not exist, and now the following command successfully manually mounts my folder sudo mount -t vboxsf tfs /media/tfs. How do I get the automount to work as intended without resorting to editing /etc/fstab?
It turns out that a few more steps are needed to configure the automount for shared folders of virtualbox. This tiny forum post was the key. You need to enable and start the virtualbox service vboxservice.service installed with the guest utils.
First ensure you have a folder /media, this is where it will try to mount your shared folders
Ensure that the guest utils are installed with sudo pacman -Q virtualbox-guest-utils
Enable service with sudo systemctl enable vboxservice.service
Start service with sudo systemctl start vboxservice.service
Reboot, I tried just logging out but reboot was necessary for me to start the service
Verify that your folder is now automounted in /media with sf_ prefix, mine is /media/sf_tfs
p.s. I also ran this command based on another post to add my username to the vboxsf group, although I'm not sure whether this one was necessary or not. sudo usermod -aG vboxsf brandon

mkdir: cannot create directory : Protocol error : Virtualbox Shared folder

I am trying to create folders and file in Virtualbox shared folder from Host to guest.
But i get this error mkdir: cannot create directory : Protocol error.
Below are steps i performed to share folder
1:My host OS is Ubuntu and my guest is Ubuntu.
2:I attached a share folder to virtualBox VM
Folder Path:/DR/vault/config
Folder:config selected automount and make permanent.
3:In Guest OS i installed virtualbox guest additions
4:I am trying to mount folder on /mount/config path
I added entry in guest's /etc/fstab as
/config /mount/config vboxsf rw,uid=1000,gid=1000 0 0
Path gets successfully mounted after Guest reboot also i can see the files created in /DR/vault/config(Guest) to /mount/config(Guest) but i cant create folder or file in /mount/config (Guest)
Please suggest if anything is missing or if there is any other way.
In my case, I had the drive full, clearing some space on the drive solved the issue.
I have found this is a problem with filename lengths on DOS hosts.
I have been using VirtualBox VMs as a form of containerised environment for deploying to a JBoss server, having experienced far too many problems with Windows environments for said technology.
I was using a shared-directory with my host machine as I was trying to keep the virtual machine lightweight (i.e. keeping IDEs in the host machine), then checking code into the shared directory for deployment with Maven. However, maven was giving some odd errors when the directory length grew to over 255 characters. Try looking at your file absolute path (type "pwd") and seeing if it's longer than 255.
I've resolved this problem with the following:
On the guest machine, add your user to vboxsf group: sudo adduser username vboxsf
Restart the host machine.
My host OS is Windows, my guest OS Ubuntu.
This might be an indication that the folder does not have the correct permissions on the Virtualbox host.
E.g. my headless Virtualbox server is running as "vbox" user, so I had to give that user write permissions on the host folder.
I had a similar issue, turns out that for me it was the number of folders or length of path name involved in mkdir.
typically I had :
mkdir -p /projects/bot/node_modules/webpack/node_modules/uglifyjs-webpack-plugin/node_modules/uglify-js/node_modules/yargs/node_modules/cliui/node_modules/center-align/node_modules/align-text/node_modules/kind-of/node_modules/is-buffer
Manually I could create up to the last part of the path but not the 'is-buffer' folder
I am working in vagrant and my projects folder is a shared VM folder, maybe/probably windows' max path length is the reason.

Sharing a directory from the VM to the host

I use config.vm.synced_folder to sync folders from the host to the VM, but I'd like to sync it in the other direction. Is this possible using vagrant/virtualbox?
By default Vagrant uses VirtualBox's vboxsf to sync folders between host and guest.
It is two way, so if you make changes to the files in /vagrant_data in the guest, it changes the corresponding files in the host's directory. You don't need to do it again the other way around.
Other options to sync files:
rsync
sshfs
NFS
See more => Synced Folders
If I understand correctly, you're looking to create a shared folder for Vagrant where files are being added from the guest machine and should show up in the host machine?
If that's the case, you're still going to have to create the host folder. I'm afraid Vagrant won't create the directory for you from a config.vm.synced_folder line in your Vagrantfile, but it will work fantastically once the host directory exists.

Permanently mount shared folder in Mint Linux running on Virtual Box

I have installed mint Linux 8.0 on Virtual box.
I have created a shared folder in virtual box and i have mounted on linux using mount command.
The problem here is as soon as i shut down and restart linux the mounted folder will not available and (i need to re mount it again).
So how i can mount the shared folder permenently on linux so that i can access any time?
You can mount the shared folder on startup by adding it to fstab.
I am currently using:
Linux Mint 17.3
VirtualBox Version 5.0.16 with Guest Additions installed
The way that I auto mount the drives upon loading is by modifying the
rc.local file located in the /etc folder.
Instructions:
Create a folder on the host machine and create a folder on on the virtual machine
Note: I don't recall if the names need to be named same (including case). Also, I put all of my shared folders in my Documents folder.
Add the folder to the virtual machine's list of shared folders
Click on the virtual machine in VirtualBox
Click on Settings
Click on Shared Folders
Click on the add folder button (located on the right side of the window
Give the folder path, folder name, and click on the "Make Permanent" checkbox
Click the okay buttons
vim into rc.local by typing sudo vim /etc/rc.local in the virtual machine
Note: You will need super user privileges to modify the file which is why sudo is there.
Append the mount command.
Example:
mount -t vboxsf <Folder_Name> /home/< My_Name >/Documents/< Folder_Name >
Note: Be sure to check your syntax in the terminal before appending the command. You won't need a sudo here because it is implied. You will want to double check yourself here because a bad line will prevent further lines from being executed and it won't tell you that there was an error.
Save and exit. (I use wq)
The folder should be mounted when you restart your computer next time.