Read-only Shared Folder for Vagrant - linux

I would just like to ask if it's possible to share a folder from the guest VM in vagrant as a read-only to the host machine? My use case is I want to be able to see the logs of the guest VM in the host machine so I can check it using other software. I am currently using a PuPHPet generated vagrant box.
I tried to do a shared folder (with RW perms) but sadly, the direction of this is from host machine down to the guest VM. That means that the guest machine only has files if the host machine adds new files. I need the reverse of this process, which means reading the files of the guest machine from the host machine.
Thanks,
Jan
HOST: Windows 10 with Virtual Box
Guest: Ubuntu Linux 64bit

Shared directories in Vagrant are not direction dependent. A file created in the guest will show up in the host, the same as files from the host show in the guest.
Check your shared directory settings and check that you are looking in the correct directory.

Related

DVC Shared Windows Directory Setup

I have one Linux machine and one Windows machine for developments. For data sharing, we have set up a shared Windows directory in another Windows machine, which both my Linux and Windows can access.
I am now using DVC for version control of the shared data. To make it easy, I mount the shared Windows folder both in Windows and in Linux development machine. In Windows, it looks like
[core]
analytics = false
remote = remote_storage
['remote "remote_storage"']
url = \\my_shared_storage\project_dir
In Linux, it looks like:
[core]
analytics = false
remote = remote_storage
['remote "remote_storage"']
url = /mnt/mount_point/project_dir
As you can see, Windows and Linux have different mounting points. So my question is: is there a way to make that both Windows and Linux have the same ùrl in the DVC configuration file?
If this is impossible, is there another alternative solution for DVC keeps data in remote shared Windows folder? Thanks.
If you are using a local remote this way, you won't be able to have to the same url on both platforms since the mount points are different (as you already realized).
The simplest way to configure this would be to pick one (Linux or Windows) url to use as your default case that gets git-committed into .dvc/config. On the other platform you (or your users) can override that url in the local configuration file: .dvc/config.local.
(Note that .dvc/config.local is a git-ignored file and will not be included in any commits)
So if you wanted Windows to be the default case, in .dvc/config you would have:
[core]
analytics = false
remote = remote_storage
['remote "remote_storage"']
url = \\my_shared_storage\project_dir
and on your Linux machine you would add the file .dvc/config.local containing:
['remote "remote_storage"']
url = /mnt/mount_point/project_dir
See the DVC docs for dvc config --local and dvc remote modify --local for more details:
https://dvc.org/doc/command-reference/config#description
https://dvc.org/doc/command-reference/remote/modify#command-options-flags

How to join an BITMAIN Antminer to a Microsoft Windows Server 2008 Active Directory

Let's start with "WHY?":#nerdsLoveToStartWithWhy
I'm developing a customized software to manage a crypto-mining farm where we need to communicate with miners (BITMAIN Antminer) by their hostname instead of IP (just for ease of use).
I know! But I don't want to scan IP ranges, then either SSH to them or use API to pull out the information such as the hostname
My Solution:(please share if you have a better solution)
I've configured a Microsoft Windows Server 2008 Active Directory & DNS with a domain name as ts.facility.com and I'm trying to join my Antminers to this domain.
Scenario:
The SRV1 is my AC DC and visible to the miners. The miner with a hostname as antMinerThree which is running a linux Angstrom V2013.12 are getting reply from the ACDC with its FQDN. the ntpdate package is installed as perquisite:
command: #opkg install ntpdate
Problem:
The problem for now is that when to install required packages:
samba
krb5-config
krb5-user
winbind
libpam-winbind
libnss-winbind
I got the following error: bmminer.list
Failed to open //var/lib/opkg/info/bmminer.list: No such file or directory.
and when I created manually an empty file bmminer.list in the path /var/lib/opkg/info/ I still get this error message, unless it no longer complains about missing bmminer.list:
Question
Does any body know, how to install required packages to joint this miner running Linux Angstrom V2013.12 to a Microsoft Windows Active Directory 2008 in order that I could ping my miners by hostname instead of by their IP addresses?

Access shared folder using a specific windows credential

I'm currently working with a requirement: download a file from the database then write it to a shared folder. Temporarily, I'm working on a path on my local:
File.WriteAllBytes(path, content);
My problem is the shared folder is on a windows machine and only a specific account will be allowed to write to this folder.
Now I know the basics of Impersonation but I don't know if it is possible to impersonate on a Docker container on a Linux machine.
In short, I want to deploy my application on a Linux container then write a file to a windows shared folder with limited access.
Is the folder on the host or mounted on the host? If so you can then map the host folder to the container. e.g.
C:\> "Hello" > c:\temp\testfile.txt
C:\> docker run -v c:/temp:/tmp busybox cat /tmp/testfile.txt
c:/temp being a local path on the host
/tmp being the path in the container.
More details here: volume-shared-filesystems

Vagrant shared folder without sync

How can I have a shared folder (access to the same folder from both host and guest machines) WITHOUT any syncing method running? (I want to use my own rsync script which is exactly what I need without the Vagrant file sharing performance penalties).
I have tried
config.vm.synced_folder ".", "/vagrant", disabled: true
but it disables the entire share.
I'm using Vagrant 1.8.1 on Windows 7 (host) with Virtualbox 5.0.12 and guest OS is Ubuntu 12.04.
You can indeed share a folder simply using the VirtualBox Manager.
Disable the Vagrant synced folder (in the vagrantfile):
config.vm.synced_folder ".", "/vagrant", disabled: true
Install Guest Additions to VirtualBox
Open VirtualBox Manager and select Settings > Shared Folders > Adds new shared folder (sic)
Add your host path in "Folder Path:" and your guest name (eg FolderName) in "Folder Name:"
Your guest name will appear in the guest linux in /media/sf_FolderName
Give your preferred guest user access to the folder. I did sudo adduser vagrant vboxsf and sudo chmod 777 /media/sf_FolderName and it DID NOT WORK for me - vagrant user still gets permission denied. Those commands seem to have worked for others, but I have ended up just working as root, which does have access.
Incidentally, here's my rsync formula (with a watch that polls every second) which works really well for me.
sudo watch -n 1 rsync -avh --delete --exclude-from=/media/sf_FolderName/FOLDERTOCOPY/rsync-exclude.txt /media/sf_FolderName/FOLDERTOCOPY /path/to/destination
NOTE: It works only if you're making changes on the host (eg developing using editor in Windows in my case). If you're making changes on the guest (eg git pull) you're gonna wanna stop this the watch/rsync from running and manually copy back in the other direction. Not ideal, but at least developing with this setup is fast.
Thanks to Frederic Henri for nudging me in this direction.

CDH 5.3 won't boot after switching from NAT to bridged networking

I've downloaded the cloudera-quickstart-vm-5.3.0-0-virtualbox.7z virtualbox image and started it. Hadoop was running. I could ping from guest to host, but not from host to guest (fairly common one-way ping problem). I also could not connect ssh from host to guest even though sshd was running on the guest (CentOS 6.4).
I downloaded a couple of data files in *.txt.gz format to the guest (CentOS 6.4). When I uncompressed them the *.txt files were garbage. I did the same on my host OS (Ubuntu 14) and the files were fine.
I shutdown CDH and changed to bridged networking and now when I reboot CentOS guest it hangs after several minutes showing the progress bar at 100% and "CentOR 6.4" showing in the bottom right.
Is there a fix for this problem or is the CDH 5.3 virtualbox image just broken?

Resources