Getting Rsync 3.0.9 to work on Vagrant VM box through Cygwin on windows 7 - ruby-on-rails

My vagrant VM box is super slow when I try to run my Rails app on it, and I'm guessing it's due to the shared folder problem.
I am trying to use rsync to circumvent the problem.
I installed Cygwin and necessary packages, put C:\cygwin64\bin; as PATH environment variable
and then changed my Vagrantfile to
config.vm.synced_folder ".", "/vagrant", type: "rsync"
When I run vagrant up, I Get this error message
$ vagrant up Bringing machine 'default' up with 'virtualbox'
provider... "rsync" could not be found on your PATH. Make sure that
rsync is properly installed on your system and available on the PATH.
What's going wrong here?
Thank you so much ... if there's any other way to run Vagrant VM box smoothly and faster on Windows 7, I would love to hear it too.

This turned out to be a bunch of brick-walls you have to circumvent when installing Rsync and setting it up correctly for Vagrant on Windows 7.
First of all, the error "rsync" could not be found on your PATH. Make sure that rsync is properly installed on your system and available on the PATH. was due to the fact that
1) Environment variable for Cygwin was placed in the latest order in the PATH, I changed it to the beginning of the path
2) During installation of Cygwin and Rsync, I installed individual "subpackages" instead of installing everything, thinking that it would be okay. Turns out I was wrong. I installed everything in the Admin package and Net package (not the SRC but just the bins), and then it started working. I suggest you set-up Cygwin again and really try to download everything if you see that error.
(I found these solutions through this post on SO cygwin + rsync)
Now, I could go into CMD and type rsync, and it would show up correctly. But then when I ran vagrant up it gave me another error saying
There was an error when attempting to rsync a synced folder. Please inspect the error message below for more info.
Host path: /c/Users/xxxxx Guest path: /vagrant
Command: rsync --verbose --archive --delete -z --copy-links
--chmod=ugo=rwX --no-perms --no-owner --no-group --rsync-path sudo rsync -e ssh -p 2222 -o StrictHostKeyCh
/c/Users/xxxx / vagrant#127.0.0.1:/vagrant
Error: cygwin warning: MS-DOS style path detected:
C:/Users/xxxxxxx Preferred POSIX
equivalent is:
/cygdrive/c/Users/xxxx CYGWIN
environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames Warning: Permanently added '[127.0.0.1]:2222' (ECDSA) to the list of
known hosts. rsync: change_dir "/c/Users/xxxxxxx"
failed: No such file or directory (2) rsync error: some files/attrs
were not transferred (see previous errors) (code 23) at
/usr/src/ports/rsync/rsync-3.0.9-1/src/rsync-3.0.9/main.c(1052)
[sender=3.0.9]
I googled solution to this error and found this site. https://github.com/mitchellh/vagrant/issues/3230
Then there's a bug with Vagrant and cwrsync that I mentioned in #3086.
For now, just edit
C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.5.1\plugins\synced_folders\rsync\helper.rb
and add hostpath = "/cygdrive" + hostpath to line 74. It's a terrible
solution but quick and simple.
Editing that helper.rb file and adding hostpath at line 74 (just made some blank lines right there and pasted it in) and now it works perfectly!!!!
Rsync makes the shared folder soooooo much faster on Rails!!!! I think it is worth the pain of setting it up correctly. Try it!!

It's not clear from your message, but I think you installed rsync on your machine (the host), while it needs to be installed on the virtual machine you bringing up (the guest).

Related

Composer Docker image won't run at all

I'm attempting to learn how to create a Laravel Docker image by following a tutorial on DigitalOcean using WSL. Following the instructions on the Docker Hub page, however, yields an error:
❯ docker run --rm --interactive --tty -v $(pwd):/app composer install
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 94 installs, 0 updates, 0 removals
- Installing voku/portable-ascii (1.4.10): Failed to download voku/portable-ascii from dist: Could not delete /app/vendor/voku/portable-ascii/src/voku/helper:
Now trying to download from source
- Installing voku/portable-ascii (1.4.10):
[RuntimeException]
Could not delete /app/vendor/voku/portable-ascii/src/voku/helper:
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...
How can I diagnose what I'm doing wrong?
It turns out that the underlying problem had nothing to do with Docker at all. In fact, Composer was trying to tell me what the problem was all along, but I dismissed it as just a symptom of a deeper issue:
[RuntimeException]
Could not delete /app/vendor/voku/portable-ascii/src/voku/helper:
This message was the crux of it all. I noticed that the directory mentioned, [...]/helper, was empty, so I tried to remove it by hand with rmdir. Instead, I got a No such file or directory error message. I attempted many other was to kill this directory, the entire project directory with rm -rf ~/laravel-app from the home folder, etc. Nothing worked.
Some digging around on the internet suggested that it could be an NTFS corruption if I was running into this issue on Windows. Since I am, indeed, attempting this on WSL (Windows Subsystem for Linux), I gave their suggested fix a try: running chkdsk /F in CMD/PowerShell. A reboot was necessary to complete this task, but after getting everything back up and trying those first few tutorial steps again, I was able to get composer to install the Laravel dependencies without a hitch.
Bottom line: If you run into this sort of issue on WSL, please try running chkdsk /F and reboot. You might just have a similar file system corruption.
We have two possibilities for this error:
1 - You did not execute the command inside the directory :
cd ~/laravel-app
2 - I'm sure there is an internal proxy that is blocking the download of packages.

Docker Toolbox Error: Looks like something went wrong in step 'Setting env'

I had Docker Toolbox installed on my Windows 7 PC and I wanted to upgrade my Docker installation to the most recent version. To do that, I decided to delete Docker Toolbox from my system and reinstall it. I uninstalled Docker Toolbox, uninstalled VirtualBox, and removed all instances of both in my files (such as files in AppData). After reinstalling Docker Toolbox and launching the Quickstart Terminal, I ran into the following error:
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this vi
rtual machine, run: C:\Program Files\Docker Toolbox\docker-machine.exe env defau
lt
Looks like something went wrong in step 'Setting env'... Press any key to contin
ue...
So it seems like it failed when "setting env". I'm not sure what that means in this context and I wish there was a way to check some extended logs to get more detail. I tried following the Docker documentation pointing the location of daemon logs in AppData, however, I could not find anything relevant. Something I did find was a file called "no-error-report", though it was empty.
I tried uninstalling everything again and reinstalling with the attribute NDIS5 network type checked, I've ran the Quickstart Terminal as admin, and I still ran into the same exact error.
Any suggestions on how I may approach this issue?
I got this same issue.
I fixed this by doing the below procedures.
I changed the below lines in start.sh
STEP="Setting env"
eval "$("${DOCKER_MACHINE}" env --shell=bash --no-proxy "${VM}" | sed -e "s/export/SETX/g" | sed -e "s/=/ /g")" &> /dev/null #for persistent Environment Variables, available in next sessions
eval "$("${DOCKER_MACHINE}" env --shell=bash --no-proxy "${VM}")" #for transient Environment Variables, available in current session
Changed --no-proxy to --http_proxy since I am using http proxy

Docker: Looks something went wrong in step Looking for vboxmanage.exe

I just installed Docker Toolbox on my windows 7 machine.
After installing I run the Docker Quickstart terminal which displays the following message:
Looks something went wrong in step nLooking for vboxmanage.exen... Press any key to continue....
Anyone here who knows how to solve this?
Regards,
The same thing happened to me. At this moment I am using Windows Home.
At least in my case, what happened was that the environment variables DOCKER_MACHINE and DOCKER_TOOLBOX_INSTALL_PATH were not created for the system.
I just had to add them and it worked.
Solved the problem by cleaning my .bashrc file.
More specific, i removed the cd , which makes perfectly sense.
For me, the problem was that the DOCKER_TOOLBOX_INSTALLPATH was only set for the user used to escalate priviligies at installation. When I run Docker Quickstart as my regular user, the DOCKER_TOOLBOX_INSTALLPATH variable is empty, producing the error.
Setting DOCKER_TOOLBOX_INSTALLPATH system wide solved the problem.
I'm Windows 8.1 user, I got the same problem when I installing the Docker Toolbox.
Because I have a previous version of VirtualBox installed, so I uncheck the VirtualBox install option in the Docker Toolbox installer.
After the install and I run Docker Quickstart terminal and get the same problem looks like something went wrong in step 'looking for vboxmanage.exe'.
Look at the file D:\Docker Toolbox\start.sh, there are some code fragment:
STEP="Looking for vboxmanage.exe"
if [ ! -z "$VBOX_MSI_INSTALL_PATH" ]; then
VBOXMANAGE="${VBOX_MSI_INSTALL_PATH}VBoxManage.exe"
else
VBOXMANAGE="${VBOX_INSTALL_PATH}VBoxManage.exe"
fi
The start.sh use $VBOX_MSI_INSTALL_PATH and ${VBOX_INSTALL_PATH} Environment Variables to locate the VBoxManage.exe.
And I find my system variables VBOX_MSI_INSTALL_PATH is
D:\VirtualBox
and then, I change it to
D:\VirtualBox\
It works fine!
Or maybe you miss the VBOX_MSI_INSTALL_PATH/VBOX_INSTALL_PATH Environment Variables.
This is my first answer on stackoverflow, I hope this will help you! Finally forgive my poor english ):
For me, it helped to start Docker Quickstart Terminal with admin privileges.
This works if you do not have admin rights:
> Setx DOCKER_MACHINE "C:\Program Files\Docker Toolbox\docker-machine.exe"
> Setx DOCKER_TOOLBOX_INSTALL_PATH "C:\Program Files\Docker Toolbox\\"
> Setx VBOX_MSI_INSTALL_PATH "C:\Program Files\Oracle\VirtualBox\\"
The double backslash in the end makes sure that the variable is saved with one backslash as last character, needed in C:\Program Files\Docker Toolbox\start.sh:
> echo %DOCKER_TOOLBOX_INSTALL_PATH%
C:\Program Files\Docker Toolbox\
Running docker as Administrator solved the problem for me.
I had the same issue.
Inside your toolbox installation folder you should be able to find the installers folder, there you'll find a setup.exe for a Oracle Virtual Box. Double click it, install it and you should be able to reopen the Docker Quickstart with no problems.
Hope this helps!
Cheers! :D
Simple solution: I thought I could just double click on it, but instead need to bring up a windows command prompt, CD to C:\Program Files\Docker Toolbox , and type
sh start.sh
Due to the relative DOCKER_MACHINE path definition on L10, it seems that start.sh will only run when you are inside its directory. I fixed it by modifying the target of the "Docker Quickstart Terminal" shortcut as follows:
C:\Tools\Git\git-bash.exe -c "cd /c/tools/docker; ./start.sh"
Substitute the paths to GitBash and Docker Toolbox to match your installations. If your paths contain spaces, be sure to wrap them in quotes as usual. For example:
"C:\Tools\Git Bash\git-bash.exe" -c "cd '/c/tools/docker toolbox'; ./start.sh"
For context, I had GitBash and VirtualBox already installed before installing Docker Toolbox, so I deselected those options during its install. I'm sure that if I went with the default options, this issue wouldn't have happened. That's probably why some folks on GitHub suggest uninstalling VirtualBox and re-installing Docker Toolbox. Don't do that, it's almost certainly unnecessary.
Do you know how good an open-source program is?
You can actually investigate the issue yourselve, which could be way more precise.
please scroll the quickstart terminal up and see which error message you have got
open C:\Program Files\Docker Toolbox\start.sh (Where you install docker toolbox) with text editer, e.g. sublime text
and see the codes
if it is in step "looking for vboxmange.exe", it should be before STEP="Checking if machine $VM exists" and there are only 50 lines to read
As of 2018-11-27, the only two error that could be given in this step is from these lines, so investigate and find your error in it:
which are:
if [ ! -f "${DOCKER_MACHINE}" ]; then
echo "Docker Machine is not installed. Please re-run the Toolbox Installer and try again."
exit 1
fi
if [ ! -f "${VBOXMANAGE}" ]; then
echo "VirtualBox is not installed. Please re-run the Toolbox Installer and try again."
exit 1
fi
In which:
DOCKER_MACHINE="${DOCKER_TOOLBOX_INSTALL_PATH}\docker-machine.exe"
And
if [ ! -z "$VBOX_MSI_INSTALL_PATH" ]; then
VBOXMANAGE="${VBOX_MSI_INSTALL_PATH}VBoxManage.exe"
else
VBOXMANAGE="${VBOX_INSTALL_PATH}VBoxManage.exe"
fi
So, check your environmental variables and echo it.
In my case, the reason is that DOCKER_TOOLBOX_INSTALL_PATH is an admin user variable:
So, run the quickstart terminal as admin user or put the variable under System variable would do the work
I personally solved this issue by adding the following property to my env (Windows Env variables):
DOCKER_TOOLBOX_INSTALL_PATH=C:\Program Files\Docker Toolbox\
as pointed out by the start.sh script of the Docker Toolbox installation.
You can solve this reinstalling the VirtualBox, choosing repair mode.
C:\Program Files\Docker Toolbox\installers\virtualbox -> virtualbox.exe
enter image description here
After finished the process, restart you machine and smile!
For Windows 7 users:
Change value "C:\Program Files\Oracle\VirtualBox\" to "C:\Progra~1\Oracle\VirtualBox\" for VBOX_MSI_INSTALL_PATH system variable in environment variables.
If you are running docker from admin cmd then just try to scroll up and you will get the error message, and then you can solve the issue.
For me the the error "Docker Machine is not installed. Please re-run the Toolbox Installer and try again."
But unfortunately reinstall did not solve the issue.
I also had this problem on Win 10 Home and I tried probably every solution from this topic but nothing works, only thing that worked for me was hardcoding Path to VBOX in start.sh.
So in start.sh in this part:
STEP="Looking for vboxmanage.exe"
if [ ! -z "$VBOX_MSI_INSTALL_PATH" ]; then
VBOXMANAGE="${VBOX_MSI_INSTALL_PATH}VBoxManage.exe"
else
VBOXMANAGE="${VBOX_INSTALL_PATH}VBoxManage.exe"
fi
I did this:
STEP="Looking for vboxmanage.exe"
if [ ! -z "$VBOX_MSI_INSTALL_PATH" ]; then
VBOXMANAGE="C:\Program Files\Oracle\VirtualBox\VBoxManage.exe"
else
VBOXMANAGE="${VBOX_INSTALL_PATH}VBoxManage.exe"
fi
And this works very well.
I know that this solution(hardcoding path) isn't best possible but it's only one which worked for me, and I think that sometimes it's better to use bad solution which works than good one which didn't work
This happens when the user connects to some sort of secured networks using VPN, TLS machine certs gets messed up, upon restarting machine and regenerating TLS machine certs, docker toolbox is configured to use the default machine with IP 192.168.XX.XX
In windows 8.1, I solved the problem by just adding extra \ to the DOCKER_TOOLBOX_INSTALL_PATH environment variable.
Installer has created the user variable for admin as DOCKER_TOOLBOX_INSTALL_PATH=C:\Program Files\Docker Toolbox
, but it should be
DOCKER_TOOLBOX_INSTALL_PATH=C:\Program Files\Docker Toolbox\
For people that installed docker with chocolatey you need to install VirtualBox separately from docker with choco install virtualbox and set environment variables as this
DOCKER_MACHINE == "C:\Program Files\Docker Toolbox\docker-machine.exe"
DOCKER_TOOLBOX_INSTALL_PATH == "C:\Program Files\Docker Toolbox\"
VBOX_MSI_INSTALL_PATH == "C:\Program Files\Oracle\VirtualBox\"
don't forget to add \ at the end of the folders
I faced same issue on my Windows 7 machine and below steps has resolved the same
Went to C:\Program Files\Docker Toolbox\installers\virtualbox and doubleclick virtualbox.msi to install Oracle Virtual box. (Note : It will install andd ask permission for 3-4 more components, Grant them all)
Set up the Env Variables
DOCKER_MACHINE C:\Program Files\Docker Toolbox\docker-machine.exe
DOCKER_TOOLBOX_INSTALL_PATH C:\Program Files\Docker Toolbox
Restart the machine
Finally Open Docker Quickstart Terminal and give it some minutes (probably 5-10) to let it do the setup
I am having the same issue with the vboxmanage.exe upon running my docker toolbox.
I managed to solve the problem by installing virtualbox since I did not install virtualbox on my computer.
Might as well give it a try.
Docker Tool Box is not a standalone application. It has many other tools like Oracle Virtual Box, Git & docker engine itself.
./start.sh is seeking some existing configuration which might miss in the older version. I updated the GIT version from 2.0.x to 2.12.x & it works for me.

Erlang install: "Can't find config file " error message

I'm trying to install Yaws on my Ubuntu 11.01 system via apt-get install yaws. But when I call the shell script yaws from the command line I get the following error: Yaws: Bad conf: "Can't find config file "
Unless my aging eyes are missing something, I can't find enlightenment in either the Yaws website or Zachery Kessin's book.
I can find configuration files in /etc/yaws. But is there something else I need to know/do?
Thanks,
LRP
If you installed yaws with the package manager then it's controlled by an init script (and you should work with that instead of running yaws manually, I'll add).
You're most likely running yaws as a non-privileged user, and if you look closely, the directory /etc/yaws is:
drwxr-x--- 4 root yaws 4096 Aug 7 10:36 yaws
You're probably trying to run yaws under a user other than root, and without membership in the yaws group.
I would venture a guess that this is a bug in the distro's packaging rather than in yaws since the man page clearly states that running it as a non-privileged user it falls back to reading /etc/yaws/yaws.conf, except that under Debian/Ubuntu (I'm on Debian 6) the permissions on /etc/yaws/ do not live up to the claim in the map page.
But, if you work through the distro's init script and daemon management facilities your problem goes away magically. That I think is preferable to tapping the Debian packager on the shoulder and having a long conversation about config directory permissions. :)
Try doing the following.
$ touch yaws.conf
$ yaws
Hit the enter key to bring up the prompt. Works on Debian 7 (wheezy).
You may also want to do the following to place your username in the yaws group.
$ adduser USERNAME yaws
To one of the maintainers of this package found in the readme file, I have pointed them to here.
$ dpkg -L yaws | grep -i readme
My system is Debian 7 or often called wheezy distro. It's actually kali-linux but that's just fyi stuff. I browsed to /etc/yaws as root with nautilus otherwise it's locked.
~$ sudo su
[sudo] password for username:
# nautilus
Initializing nautilus-gdu extension
Now you may look in the /etc/yaws directory.
The yaws.conf should be in there. Josef would be correct as this is what yaws will try to use if the user has access to this file. But not being root you don't.
My solution is to just get ideas out of that file and the others within the same directory. Take this next answer from Van and make your home/user have a yaws.conf and play around with different configurations from what you found in the etc one. Not that hard to copy and paste if you just have access to the files. Enjoy! :-D

Capistrano deploy in Virtual Machne

I using Virtual box + gem Vagrant
One week before everything works well.
I had packaged my box. And now I've deployed the box again with the same project.
and Capistrano has outputted error:
*** [err :: 33.33.33.10] creating symbolic link `/vagrant/demoapp/current/log'
*** [err :: 33.33.33.10] : Read-only file system
https://gist.github.com/1746250 (error + deploy.rb)
I have set sudo chmod 777 -R 1vagrant/
But it still doestn't work.
What happen?
There is a workaround to make symlinks in shared folders work on VirtualBox 4.1.8+ again. Basically you need to issue this command:
VBoxManage setextradata VM_NAME VBoxInternal2/SharedFoldersEnableSymlinksCreate/SHARE_NAME 1
You can do this in the context of Vagrant by adding this to the Vagrant::Config.run block of your Vagrantfile:
config.vm.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/SHARE_NAME", "1"]
More information can be found on VirtualBox bug #10085.
Please note the commenter that shares the setextradata trick forgets to tell you the key name requires the SHARE_NAME. I found this out digging through the C code!
Official answer of Vagrant gem's author:
The VirtualBox shared folder filesystem doesn't allow symlinks, unfortunately.
Your only option is to deploy outside of the shared folders.
https://github.com/mitchellh/vagrant/issues/713

Resources