unable to run RunProgramInGuest using vmrun in VmwareWorkstation 15 - ubuntu-16.04

While running the command
/usr/bin/vmrun -T ws -gu username -gp password runProgramInGuest /home/vmware/Ubuntu\ 64-bit/Ubuntu\ 64-bit.vmx -noWait -activeWindow -interactive /usr/bin/strace -o /home/logdir/trace.txt -etrace=forkcloneexecvechdiropencreatclosesocketconnectacceptbindreadwriteunlinkrenamekillpipedupdup2 -s 216 -f /home/malware_analysis/bb0b00438aa782f41a02b434f2c525f2d4a4662604e4254dca8c6a896adaff3a
I am getting the following error:
Error: The specified guest user must be logged in interactively to perform this operation
My setup is as follows :
VMware Workstation 15
Host OS -Ubuntu 16.04
Guest OS OS -Ubuntu 16.04

Delete the .lck files created in the vmware folder where virtual machine files are stored.

Related

CISCO IOS-XR, Python3.7, Not able to run commands like 'ls' and 'df' on Cisco router

Cisco ios-xr router using CLI:
RP/0/RP0#show version
Thu Nov 25 07:53:59.103 UTC
Cisco IOS XR Software, Version 6.5.32.11I
Copyright (c) 2013-2020 by Cisco Systems, Inc.
RP/0/RP0#run
Thu Nov 25 07:54:05.231 UTC
[xr-vm_node0_RP0_CPU0:~]$df
Filesystem 1K-blocks Used Available Use% Mounted on
rootfs 3966080 1332040 2412860 36% /
76892 11848320 43% /mnt/ecu/vdd
[xr-vm_node0_RP0_CPU0:~]$
Using python:
I am able to run show commands using Connecthandler .send.command:
from netmiko import ConnectHandler
import subprocess
Network_Device = {"host": "10.111.22.333", "username": "USER123", "password": "Pass123", "device_type": "cisco_xr",}
Connect = ConnectHandler(**Network_Device)
Connect.enable()
version1 = "show version"
print(Connect.send_command(version1))
But not able to run 'df' or 'ls' commands, as not able to reach bash prompt i reach by running 'run' command on router.
I tried:
disk1files = subprocess.run("df", stdout=subprocess.PIPE)
print(disk1files.stdout.decode())
But seems its wrong. Please suggest the right library or code I can use here.
This is my first question here, so bear some silly questions or mistakes done in code
if on DF you are referring to "Don't fragment" then it is posible to send it like
Connect.send_command("ping 192.168.10.10 df-bit size 1600")
where 1600 represents MTU, and for ls commands is link command,
Connect.send_command("ls-active")
Connect.send_command("ls-active-enabled")
but if you are referring to df and ls in linux (disk free and list files..) then you can use os module for sending commands:
import os
os.system("ls -l")
or use call from subprocess module:
from subprocess import call
call(["ls", "-l"])
If you need to acccess cisco bash:
switch# configure terminal
switch(config)# feature bash-shell
switch# run?
run Execute/run program
run-script Run shell scripts
switch# run bash?
bash Linux-bash
switch# run bash
bash-4.2$ whoami
admin
bash-4.2$ pwd
/bootflash/home/admin
bash-4.2$

Unable to configure a new agent : Failed to create CoreCLR, HRESULT: 0x80004005

We had some 12 agents (vsts-agent-linux-x64-2.188.4) running on one Az VM (Ubuntu 20.04.2 LTS) as processes (./config.sh && screen ./run.sh). All was well..
I had to run some command related to /tmp folder but it kept showing busy and we suspected that our Agents might be using /tmp. Unfortunately instead of any other clean way of stopping the agents, we killed all processes on this VM manually, including the agents'.
After the /tmp related command ran successfully, I tried running screen ./run.sh from one of the agent directories. And I got an error:
Failed to create CoreCLR, HRESULT: 0x80004005
I also had tried :
.agent2/run.sh and I got the error :
ldd: ./bin/libcoreclr.so: No such file or directory
ldd: ./bin/System.Security.Cryptography.Native.OpenSsl.so: No such file or directory
ldd: ./bin/System.IO.Compression.Native.so: No such file or directory
ldd: ./bin/System.Net.Http.Native.so: No such file or directory
Failed to create CoreCLR, HRESULT: 0x80004005
I even downloaded a new .tar for the agent and ran a fresh ./config . But I get the same error on ./config as well
Is there a solution to this? Please help
export COMPlus_EnableDiagnostics = 0, and then running ./config from the agent directory. worked!
I had this issue when running as the non-privileged user specified in the systemd file but running as root user worked fine.
Finally used:
strace -f -o trace.log /<executable path>/<executable name>
Which led me to:
9183 mknod("/tmp/clr-debug-pipe-9183-8112345738-in", S_IFIFO|0700) = -1 EACCES (Permission denied)
This caused me to compare the /tmp directory between working and non-working boxes.
[<not-working-hostname>]$ ll /
drwxrwxr-x 7 root root 93 Jan 5 21:37 tmp
[<working-hostname>]$ ll /
drwxrwxrwt 7 root root 93 Jan 5 21:59 tmp
(Note the r-x vs rwt)
Fix:
[<hostname>]# chmod 1777 /tmp

eclipse CDT esp-idf build but don't flash

Windows10 eclipse esp-idf latest version 2021-03
With the command line idf.py I can build and flash the esp-idf\examples\get-started\blink programme which run on a ESP32.
In eclipse, the buils works but the run command display in console
Usage: C:\Users\peter\esp-idf\tools\idf.py [OPTIONS] COMMAND1 [ARGS]...
[COMMAND2 [ARGS]...]...
ESP-IDF CLI build management tool. For commands that are not known to
idf.py an attempt to execute it as a build system target will be made.
.... bla bla ...
Can anybody tells me what is wrong ?
Regards
There is a bug in the eclipse/esp-idf launch bar.
The ESP target for esp32 is defined with a Serial Port COM3.
But that info is not used.
If one redefine a new ESP Target with the same serial port under a different name, then the run command will work!
See hereafter for the people interested in the details
cmd.exe /C "cd /D C:\Users\peter\esp-idf\components\esptool_py && C:\Users\peter.espressif\tools\cmake\3.16.4\bin\cmake.exe -D IDF_PATH="C:/Users/peter/esp-idf" -D ESPTOOLPY="C:\Users\peter.espressif\python_env\idf4.2_py3.8_env\Scripts\python.exe C:/Users/peter/esp-idf/components/esptool_py/esptool/esptool.py --chip esp32" -D ESPTOOL_ARGS="--before=default_reset --after=hard_reset write_flash #flash_args" -D WORKING_DIRECTORY="C:/Users/peter/eclipse-workspace/blink/build" -P C:/Users/peter/esp-idf/components/esptool_py/run_esptool.cmake"
esptool.py --chip esp32 -p COM3 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 2MB 0x8000 partition_table/partition-table.bin 0x1000 bootloader/bootloader.bin 0x10000 blink.bin
esptool.py v3.0

swift build faild due to "database is locked" in docker contianer?

basically I am trying to learn swift in win7 using docker with following setup and steps:
1) physical machine running on win7
2) docker toolbox 1.12.5 window version installed in win7
3) open "Docker Quickstart Terminal" which is a MINGW64 console
4) in MINGW64 console,ran "docker pull swift" to pull a docker swift image
5) create container using "docker run -it --hostname=value --privileged=true --net=host -v //d/dev/tools/docker/swift://swift:z --name swiftfun 24cc712c0763 /bin/bash", which actually the volume mapping does not work. I can not create file in folder of my win7 host
swift version is :
root#value:/swift/PerfectTemplate/.build# swift -version
Swift version 3.0.2 (swift-3.0.2-RELEASE)
Target: x86_64-unknown-linux-gnu
linux container is :
root#value:/swift/PerfectTemplate/.build# cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.2 LTS"
NAME="Ubuntu"
VERSION="16.04.2 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.2 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
6) then ran this in container "mount -t cifs //10.x.x.xxx/D$/dev/tools/docker/swift /swift -o username=myusername,password=mypassword,noperm" , this time works and I can see files in my win7 folder and can write files to win7 .
7) go to the folder "/swift" in container and pull code from git as shown in this link http://perfect.org/docs/gettingStarted.html . I can see files/folders created in win7 folder
8) in container, go to folder "PerfectTemplate" and ran swift build , it failed with following message :
...
Cloning https://github.com/PerfectlySoft/Perfect-Thread.git
HEAD is now at aee3b32 Cleanup
Resolved version: 2.0.9
<unknown>:0: error: unable to attach DB: unable to initialize database (database
is locked)
error: exit(1): /usr/bin/swift-build-tool -f /swift/PerfectTemplate/.build/debug
.yaml
...
there is a file build.db created in my win7 folder D:\dev\tools\docker\swift\PerfectTemplate\.build\build.db
and the file size remains 0 byte
following is verbose info from building:
/usr/bin/swiftc --driver-mode=swift -I /usr/lib/swift/pm -L /usr/lib/swift/pm -l
PackageDescription /swift/PerfectTemplate/Packages/PerfectThread-2.0.9/Package.s
wift -fileno 4
/usr/bin/swift-build-tool -f /swift/PerfectTemplate/.build/debug.yaml -v
<unknown>:0: error: unable to attach DB: unable to initialize database (database
is locked)
error: exit(1): /usr/bin/swift-build-tool -f /swift/PerfectTemplate/.build/debug
.yaml -v
if I use linux local folder for building code then everything is working fine .the size of build.db changes . does it have anything to do with mounted drive using //ip/drive ?
how do I resolve ? Thanks
OK, it seems that sqlite is not tolerate to mapped windows folder in containers. I tried mapping folders using both //ip/folder approach and virtualbox shared folder approach . none of them works. and seems it has something to do with winLockFile,please check link below
http://sqlite.1065341.n5.nabble.com/SQLite3-database-on-windows-network-drive-and-unreliable-connection-td75875.html
https://www.sqlite.org/whentouse.html
I also checked source code of swift package manager , it seems there is no way of adding options to swift-build-tool as part of "swift build" command

Using paramiko tring to connect RHEL6.5 vm giving "Servname not supported for ai_socktype" error message

I new in python, I am try to connect RHEL vm by key authentication.I have two RHEL6.5 vm1,vm2 and Python 2.6.6 on both.
First I generate keys on vm1 and copy to vm2 as using below cmd.
On vm1 execute below cmd:
1) ssh-keygen -t rsa
2) After key generation
3) ssh-copy-id -i .ssh/id_rsa.pub root#vm2
After that I am able to login that vm2 from vm1
ssh -i /root/.ssh/id_rsa root#vm2
manually this is working fine but i am doing it programmatically by using python, below is my code: run from vm1
SSHKey.py
import paramiko
sshcon = paramiko.SSHClient()
sshcon.set_missing_host_key_policy(paramiko.AutoAddPolicy())
connection = sshcon.connect('vm2', 'root','/root/.ssh/id_rsa')
print "-----------------"
print connection
**OutPut:**
Traceback (most recent call last):
File "SSHKey.py", line 5, in <module>
connection = sshcon.connect('vm2', 'root')
File "/usr/lib/python2.6/site-packages/paramiko/client.py", line 277, in connect
socket.getaddrinfo(hostname, port):
socket.gaierror: [Errno -8] Servname not supported for ai_socktype
I think RHEL6.5 vm1 not able to communicate with RHEL6.5 vm2.Python version looks good you need to install paramiko on RHEL6.5 vm2.Run below cmd.
1) yum list python-paramiko --showduplicates
This will give you available package
2) yum install python-paramiko
This will install paramiko on your rhel vm.