Vagrant with Docker set up in Windows - Permisson denied error during rsync - vagrant-windows

I had set up a vagrant VM with boot2docker for a helloworld docker image on my windows machine. After setting it up, I wanted to sync my host machine windows folder to vm machine. As per instructions, I installed cygwin64 to get rsync on my windows machine.
After setting it up, I tried vagrant up again and I get the following permission denied error during rsync between two machines.
Do I need to set up any permissions on my vm machine?

I accomplished it without changing any permissions.
try this:
1) Open the file located at $cygwin_install_location/etc/fstab
2) replace the last line with none / cygdrive binary 0 0
(This removes the /cygwin/-prefix in its path)
and:
1) edit $vagrant_install_location\embedded\gems\gems\vagrant-1.8.0\plugins\synced_folders\rsync\helper.rb
2) remove the following lines (77-79)
"-o ControlMaster=auto " +
"-o ControlPath=#{controlpath} " +
"-o ControlPersist=10m " +

Related

vscode-remote-release and wsl 2

Has anyone already tried vscode-remote-release with the pre release of wsl 2?
I am getting the following error when starting a new wsl server:
[2019-06-15 11:14:05.702] Starting VS Code Server inside WSL.
[2019-06-15 11:14:06.526] Launching C:\WINDOWS\System32\wsl.exe bash -c "./scripts/wslServer.sh 15b7c86d86319b187a5ef255c170184a8519c5af insider .vscode-server-insiders " in c:\Users\User Name\.vscode-insiders\extensions\ms-vscode-remote.remote-wsl-0.38.0
[2019-06-15 11:14:07.126] bash: ./scripts/wslServer.sh: No such file or directory
[2019-06-15 11:15:38.680] VS Code Server for WSL failed to start. No messages received for 90s
[2019-06-15 11:15:38.680] For help with startup problems, go to
[2019-06-15 11:15:38.680] https://code.visualstudio.com/docs/remote/troubleshooting#_wsl-tips
It seems wsl2 entry path problem, try execute wsl in any folder. If your shell enter your linux's user home and not the /mnt/ path to your windows's folder path.
Currently I found reboot can resolve this problem for a while

copy folder from server to local machine in ubuntu

I have a folder in my server and I tried to copy it in my local machine like:
scp my_username#remotehost.com:/path/to/some_folder /my/local/directory
Inside some_folder there is a folder that I want to copy.
When I run this command it says
/path/to/some_folder/: not a regular file
How can I copy a folder from server to my local machine.
I am using ubuntu 14.04
You can use the -r flag on the scp command
scp -r my_username#remotehost.com:/path/to/some_folder /my/local/directory
From the manual page:
-r' Recursively copy entire directories. Note that scp follows symbolic links encountered in the tree traversal
Easy way, but you need to understand it first. I am using Linux Ubuntu 18.04.4 LTS.
To copy a complete folder with children's from Sever to Local Machine
Just go to local machine empty folder directory. Like my is "results" folder contain on desktop
-r == copy entire folder with all flies
khawar == Username on server Machine
223.120.314.49 == Server IP address
-P == Port
22 == Port Number
/data1/khawar1/lpr/Plate_Recognition-LPRnet/ == Complete directory address of server machine folder that you want to copy
results == folder in local machine
scp -r -P 22 khawar#223.120.314.49:/data1/khawar1/lpr/Plate_Recognition-LPRnet/ results
The easiest and the most interactive way is using sftp; you can manipulate the remote server as of your local machine. Let's say you have the following credentials for your remote server:
. Username: root
. ip: 185.48.22.23
1. Step one: Open your file explorer of your ubuntu local machine
2. Step two: Navigate to 'other locations'
3. Step three: Insert your credentials with sftp on the 'Connect to server' box and press 'connect'.

How do I delete a virtualbox machine in the GURU_MEDITATION error state?

How do I delete a VirtualBox machine in the GURU_MEDITATION error state? Is it enough just to delete the directory while VirtualBox is not running?
EDIT: After posting, I deleted the entire directory that "Show in File Manager" navigates to.
It looks like:
Note that there is no power off, and even remove is greyed out. I believe this is the exact same as it looked even before I deleted the directory.
EDIT 2: I tried the command line poweroff after deleting the files. It hangs:
vboxmanage controlvm wmf-vagrant_1354733432 poweroff 0%...10%...20%...
EDIT 3: It also fails to unregister it from the command-line:
VBoxManage unregistervm wmf-vagrant_1354733432 --delete VBoxManage:
error: Cannot unregister the machine 'wmf-vagrant_1354733432' while it
is locked VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE
(0x80bb0007), component Machine, interface IMachine, callee
nsISupports Context: "Unregister(fDelete ?
(CleanupMode_T)CleanupMode_DetachAllReturnHardDisksOnly :
(CleanupMode_T)CleanupMode_DetachAllReturnNone,
ComSafeArrayAsOutParam(aMedia))" at line 160 of file
VBoxManageMisc.cpp
Kill the VBoxHeadless process and run "vagrant destroy"
Destroying vagrant and sending the kill signal with the "killall" command looks like:
killall -9 VBoxHeadless && vagrant destroy
If you can't power off the machine from VirtualBox GUI, then try from the command line using vboxmanage command (VBoxManage on OS X), e.g.:
vboxmanage controlvm NAMEOFVM poweroff
Change NAMEOFVM with the name from vboxmanage list vms command.
then unregister and delete the VM:
vboxmanage unregistervm NAMEOFVM --delete
Or delete it manually:
rm -fr ~/"VirtualBox VMs/NAMEOFVM"
I hit this problem. Eveything I read recommend that you should always manage the boxes via Virtual Box, not directly access files. But when I had an invalid box, the unregistervm command refused to delete it and vagrant destroy did not work. In the end the following process worked.
Kill all running VBox* processes
Delete the folder "boxname" from the folder "VirtualBox VMs"
Edit the file "VirtualBox.xml" and remove the tag corresponding to the invalid box.
I then ran this command the verify the box was gone.
VBoxManage list vms
After that I was able to create a new vm with the same name.
I had a VM that got in a similar state
$ vagrant up
Bringing machine 'tempu' up with 'virtualbox' provider...
==> mms: Checking if box 'hashicorp/precise64' is up to date...
==> mms: Resuming suspended VM...
==> mms: Booting VM...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["startvm", "9fcf2203-d4b3-47a1-a307-61bfa580bd28", "--type", "headless"]
Stderr: VBoxManage: error: The machine 'temp-ubuntu' is already locked by a session (or being locked or unlocked)
VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component Machine, interface IMachine, callee nsISupports
VBoxManage: error: Context: "LaunchVMProcess(a->session, sessionType.raw(), env.raw(), progress.asOutParam())" at line 592 of file VBoxManageMisc.cpp
I looked for a process called VBoxHeadless, but it wasn't running.
I then ran ps and found this process with the same vm id:
$ ps aux | grep -i virtualbox
user 63466 0.0 0.1 2523608 8396 ?? S 9:36am 0:02.67 /Applications/VirtualBox.app/Contents/MacOS/VBoxManage showvminfo 9fcf2203-d4b3-47a1-a307-61bfa580bd28 --machinereadable
Killing that process fixed the problem and VM started correctly after running vagrant up
This is a script I use when I get desperate. It wipes as much trace of any VM from the machine as I can find:
VBoxManage list runningvms | awk '{print $2}' | xargs --no-run-if-empty -t -n1 -IXXX VBoxManage controlvm XXX poweroff
VBoxManage list vms | awk '{print $2}' | xargs --no-run-if-empty -t -n1 VBoxManage unregistervm
killall -9 VBoxHeadless
rm -rf ~/Virtualbox\ VMs/*
I am using Debian Wheezy on a 64-bit multiple-processor host. I was able to solve it eventually by removing all VirtualBox data (though you did not need to delete the Vagrant base box):
Close Virtualbox if running
sudo apt-get remove --purge virtualbox
Move or delete ~/.VirtualBox and ~/VirtualBox\ VMs/. If you're not sure, back them up to a safe place.
Restart.
Reinstall virtualbox.
Use virtualbox/vagrant as normal.
There may be a less disruptive way (e.g. removing only parts of these directories). In my case, fortunately I was using only one VM at the time.
In my case, I wanted to delete ALL Vagrant boxes I currently have on my system by a command line, I did that by:
$ vagrant box list | cut -f 1 -d ' ' | xargs -L 1 vagrant box remove -f --all
Of course, after making sure no further process is attached any more:
killall -9 VBoxHeadless && vagrant destroy
No matching processes belonging to you were found
On windows 10, i solved this problem setting Default firewall configurations back.
Hope it helps...
I've been struggling with frozen Virtual Box instances created earlier using Vagrant.
Luckily found a solution mentioned in similar ticket
so, to recap, if your getting Timeout error or Vagrant complaining it can't provision or any other kind of related issue with Virtual Box try:
List virtual box instances first: VmboxManage list vms
Stop the virtual box instances using id|names of previous command: VBoxManage startvm VMNAME/id --type emergencystop
List vagrant boxes with vagrant box list
Remove one or more causing issues vagrant boxes: vagrant remove box ${box-name}
Afterwards, try vagrant up again and hopefully you will be back to business.
Good luck!
Open the task manager or system monitor and hover with the mouse over the VBoxHeadless to see the name of the VM and kill the process.
Now you can remove the VM with the VirtualBox Manager GUI.
Run vagrant global-status
Identify the vm id
Run vagrant destroy [vm id]
You can use below command to delete VM from vritual box-
vagrant destroy
And use below command to create VM and start again-
vagrant up

FreeSSHd in jenkins and from commandline

i have installed fresshd in one of my windows server.now i am connect to the system through putty. It is working fine.
my issue us when i am running from command line
PuTTY.lnk -ssh -2 -P 22 username#XXX -pw pswd -m command.txt
commands given in the command.txt files are not executed it just open the putty console and it is closing.
when Running from Jenkins also same issue.
I am not sure if you are connecting to Windows from a Linux machine, or to Linux from a Windows machine. Or Windows to Windows?
PuTTY.lnk is not an executable. If you try to run that, it should produce an error 'PuTTY.lnk' is not recognized as an internal or external command. I am assuming you are running the command from a Windows machine, since you are referring to windows shortcut file (.lnk)
You need to use PuTTY.exe + the rest of your command line. Please note that unless it is in your $PATH settings, you would have to provide a full path to the .exe, for example C:\LocationOfPuttyInstall\putty.exe -ssh -2 -P 22 username#XXX -pw pswd -m command.txt. For the sake of preventing any other problem, you should also specify a correct full path to the command.txt file.
If you are not sure where your Putty is installed, on the Windows machine, do the following:
Right click your PuTTY shortcut (the PuTTY.lnk file)
Look under "Target"
That would list your full path to PuTTY.exe executable.
This should resolve your problem.
p.s.
Usually Putty is used to connect from a Windows machine to a Linux machine. From your question, it almost looks like you are trying to connect from a Windows machine to another Windows machine.
You should use PsExec windows tool for such purposes:
http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx

how to create a shared folder on Virtual machine

We have a windows Oracle vm installed on our solaris machine which will be launched using Xmanager.
Can some one please help me with the following questions
I can use the folders on solaris from windows VM using "\vboxsrv" but how can i do viceversa
How can i access files on windows vm from solaris machine
And can i update the files on windows vm directly without opening it through xmanager
I found a way to execute a command on virtual machine from Hostmachine. Using this command tool I am accessing files or folders in virtual machine
The command line tool is VBoxManage - This has lot of parameters using we can do any thing on virtual machine from VM starting to shutdown
/opt/VirtualBox > VBoxManage Startvm "windows"
/opt/VirtualBox > VBoxManage guestcontrol "windows" execute --image "cmd.exe" --username root --password 12345 --wait-exit --wait-stdout -- -l /usr