how to create a shared folder on Virtual machine - solaris

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

Related

Windows subsystem for Linux : Command Not Found Error

I have installed windows subsystem for Linux to run Ubuntu 16.04 on my windows 10 home platform.
I have extracted all required directories to run KSQL on this platform.
Now, when I am trying to run any command after navigating to the bin folder. It's throwing command not found error. I tried to add PATH as well but it's not working.
Please suggest.
There's a typo in your command:
export PATH=$PATH:/opt/kafka/confleuent-5.4.0/bin
Instead of confluent-5.4.0 you misspelled it confleuent-5.4.0.
The easiest way to install Confluent CLI, is by making use of the scripted installation:
Install the Confluent CLI using this script. This command creates a
bin directory in your designated location (<path-to-directory>/bin).
The location must be in your PATH (e.g. /usr/local/bin). On Microsoft
Windows, an appropriate Linux environment may need to be installed in
order to have the curl and sh commands available, such as the Windows
Subsystem for Linux
curl -L https://cnfl.io/cli | sh -s -- -b /<path-to-directory>/bin
Finally, if you run confluent start you can get all services up and running, including KSQL (assuming that you have correct configuration files).
You could just use the path
cd bin
./kafka-topics.sh
Also, all those commands work in CMD / PowerShell as well
If you want to run KSQL, I'd suggest just using Docker

Can you pass commands to a VM from the host server?

I have written a batch file to set the IP address of a host server and the two virtual machines running on it. At the moment you have to copy the script onto each machine and run it which isn't what I want, I would like to run the script on the host server and have the commands passed to each VM.
Is this possible?
You could make a powershell script which uses PsExec(comes with sysinternals) to run a scriptblock or script file on your vm machine.
It will look something like this:
PSExec \RPC001 -i -u myID -p myPWD PowerShell C:\script\StartPS.ps1
Apparantly targetting a VM could be more tricky, see this link for more information:
Is there a way to psexec into my own virtual machine (windows xp mode)?

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