I am trying to run wireshark on mininet using a ssh session but it does not work I have this error :
error: XDG_RUNTIME_DIR not set in the environment.
and also this error :
(wireshark:1945): Gtk-WARNING **: cannot open display:
I will appreciate your help thanks !!
1)
Make sure the ssh connection is started with -X or -Y option.
Example:
ssh -X usernme#ipaddress
2)
Restart the ssh connection, that is just exit and log in again!
For each host you want to observe (lets say h1):
On mininet: xterm h1
On xterm of h1 try: wireshark-gtk instead of wireshark
Make sure you've added an host-only network adapter and connected it to the VM.
In order to so this on Virtual Box:
Open the VirtualBox preferences menu by clicking on File → Preferences
Click on Network
Click on the tab Host-only Network
Click on Add (the small green “plus” icon on the right side of the window)
An adapter called vboxnet0 will be created. The default settings should be acceptable
Then, from the VM settings assign the adapter to the Macine:
Click on the VM
Click on Settings
Click on Network
Change Network Adapter to be attached to "Host-only Adapter"
You can also use Adapter 2 and leave Adapter 1 connected by NAT to the Internet
Make sure the adapter you've just added is selected
Only then, you'll be able to connect to the VM with ssh -X usernme#ipaddress as #shr wrote.
If you ran info more issues, please read the setup notes
I got the same error like the ones mentioned in the question.
In my fix(after you ssh -X usernme#ipaddress), I changed to directory mininet/util and ran the shell script install.sh. So basically
cd mininet/util.
sh install.sh.
"sudo wireshark &". to start wireshark and you will get warning, just hit Ok
Related
I'm trying to use Xdebug (v3) through PhpStorm (v2022.3.2) to debug a PHPUnit test method from inside a Docker container.
Xdebug is correctly setup and also the server in PhpStorm is.
In fact, if I run tests from command line, Xdebug stops at breakpoints:
XDEBUG_SESSION=1 PHP_IDE_CONFIG="serverName=myapp.localhost" vendor/bin/phpunit --testdox --filter testProfileUpdate
If I debug the test clicking on the "bug" icon on the left of the test method, instead, I receive the following error:
Connection was not established. Probably 'xdebug.remote_host=host.docker.internal' is incorrect. Change 'xdebug.remote_host'.
Looking at the command executed by PhpStorm to debug a test method, here is what I see:
[docker://myapp:latest/]:php -dxdebug.mode=debug -dxdebug.client_port=9000 -dxdebug.client_host=host.docker.internal /opt/project/vendor/phpunit/phpunit/phpunit --configuration /opt/project/phpunit.xml --filter "/(ProfileTest::testProfileUpdate)( .*)?$/" --test-suffix ProfileTest.php /opt/project/tests --teamcity
Tried to configure two more flags
I've also tried to configure two more flags:
-dxdebug.idekey="serverName=myapp.localhost"
-dxdebug.session=1
The resulting command is this:
[docker://myapp:latest/]:php -dxdebug.mode=debug -dxdebug.client_port=9000 -dxdebug.client_host=host.docker.internal -dxdebug.idekey="serverName=myapp.localhost" -dxdebug.session=1 /opt/project/vendor/phpunit/phpunit/phpunit --configuration /opt/project/phpunit.xml --filter "/(ProfileTest::testProfileUpdate)( .*)?$/" --test-suffix ProfileTest.php /opt/project/tests --teamcity
Also with this configuration, Xdebug doesn't start and breakpoints are ignored (and the error message pops up).
Tried to disable params passed by PhpStorm
I tried to disable params passed automatically by PhpStorm going to Settings > PHP > Debug.
Then, in the section "Advanced settings" I unflagged the option "Pass required configuration options through command line".
Now, the resulting command is this:
[docker://myapp:latest/]:php /opt/project/vendor/phpunit/phpunit/phpunit --configuration /opt/project/phpunit.xml --filter "/(ProfileTest::testProfileUpdate)( .*)?$/" --test-suffix ProfileTest.php /opt/project/tests --teamcity
As you can see, there is no mention of xdebug.client_host nor of xdebug.remote_host.
Nevertheless, PhpStorm continues to pop up the same error mentioning xdebug.remote_host=host.docker.internal.
I imagined that an error should have occurred, but different, something saying a required parameter is missed.
Request for help
Any idea about how to configure PhpStorm to start an Xdebug session to debug a PHPUnit test?
-dxdebug.client_port=9000
Xdebug 3 now uses 9003 port by default instead of 9000. Try sticking to this.
In PhpStorm you most likely have both ports listed (9000,9003 as a default value, to cover new and old Xdebug versions) and it uses the first one for CLI scripts (which PHPUnit is). Either remove it (preferred; so you will only have 9003 there) or make it last (i.e. 9003,9000).
-dxdebug.idekey="serverName=myapp.localhost"
This will not work (wrong approach). You are trying to pass it as Xdebug IDEKey param... but it actually should be the value of the ENV variable named PHP_IDE_CONFIG.
If you want to actually use it:
Look into the PHPUnit config file: it has the ability to set up custom ENV variables for tests.
Another place: PhpStorm's Run/Debug Configuration for PHPUnit has an Environment variables field: try using it for this purpose.
Or use it in your actual docker file/config.
Other than that: enable Xdebug log (xdebug.log), try to debug (both when it's working and when it's not) and see what the log has to say for both runs (where it connects to, what the response is etc). You should spot the difference that should give the clues on what might be wrong (in which direction to dig further).
This actually should be the first step when investigating "why it works here and not there" situations.
I'm using vscode to connect to a server and I want to display an image with cv2.imshow() from openCV, but I get the following error:
qt.qpa.screen: QXcbConnection: Could not connect to display localhost:13.0
Could not connect to any X display.
I get the following warning when connecting via ssh:
Warning: No xauth data; using fake authentication data for X11 forwarding.
as suggested in many posts about the topic, I added the following lines to /etc/ssh/ssh_config on my mac:
Host *
ForwardX11Trusted yes
ForwardAgend yes
ForwardX11 yes
XAuthLocation /opt/X11/bin/xauth
on the server:
touch ~/.Xauthority
xauth add :0 . mcookie
and added the DISPLAY env variable:
export $DISPLAY=localhost:0
I know that is possible to save each image cv2.imwrite(), but in my case I'm doing some complex debugging and I cannot save every single image. I really need to do it this way.
I'm using macOS Monterrey 12.5.1
Any suggestions on what else to try?
Thanks for your help!! :)
Basically I've installed wireshark on widows 10, but so far no interface is detected on my computer. Do I need to reinstall my wincap?
my winPcap error says:
C:\WINDOWS\system32|drivers\npf.sys
click abort to stop the intsalltion,
retry again or ignore skip the file
I already done this step:
opening a command prompt as administrator (Win+R > cmd > Enter)
navigate to \windows\syswow64
delete Packet.dll
reboot
Install new version of Winpcap
Do I need to delete npf.sys?
The problem you're having is that Winpcap can't be installed because it doesn't have any permission to edit the file C:\WINDOWS\system32|drivers\npf.sys.
All you have to do is right-click on npf.sys < Properties < Security < Edit and check full control and all the other tasks.
You can solve that problem using the cmd window.
Check whether your npf status is "stopped" or not.
You can check your npf status by typing
'sc query npf'
If that status is "stopped", then you have to change it to "running".
You can change that status by typing
'sc start npf'
This is what I keep getting in the screenshot. Clicking both buttons bring up spinner which never goes away.
Thanks a lot!
This destroyed me for a very long time and was super frustrating!
I found a forum that had the advice, but can't find it now.
Go to:
C:\Program Files\Oracle\VirtualBox\drivers\vboxdrv
Right click VBoxDrv.inf and choose Install
Open administrative command prompt
sc start vboxdrv
docker-machine rm default
docker-machine -D create -d virtualbox --virtualbox-memory 2048 default
I also opened VirtualBox File>Preferences>Networks and removed all the interfaces.
Then rebooted and ran Docker Quickstart Terminal (from start menu search)
good luck
I successfully installed Fedena on Windows using this tutorial:
http://en.wikibooks.org/wiki/Fedena/Installation
The problem is that each time I start windows, I need to run the command ruby script/server so that I can access the project locally. I tried making Fedena a Windows Service that starts automatically by following the steps mentioned in the tutorial, but it seems that it didn't work.
Making a Windows Service
If you want to run Fedena as a Windows Service (which automatically starts), do the following commands:
Open the Ruby Command prompt and go to your Fedena Installation director //do they mean by this C:/Fedena?
Install a Gem:
gem install win32-service
Install a Gem:
gem install mongrel_service
Run the command:
mongrel_rails service::install -N Fedena -c C:\FEDENA -p 3001 -e production
(Replace C:\FEDENA with whatever your Fedena installation Directory is.) You may also wish to change the port from 3001 to 80 so when entering the address from other computers, it is not required that you enter a port.
Go to windows search at the start menu, type:
services.msc
Look for service named 'Fedena' and set it to automatic
Restart your computer and see if the fedena start automatically. Always make sure that your server is running.
Any ideas what could be the problem?
Right after Fedena is configured, the start of the application is via console which should stay open for all the times if we want the application to be up and running. But quite often will get closed (human error, server down etc) and the application will go down.
The same applies if the server is rebooted/bounced and all over again.
So here is the solution if you don't want to go over this hassle:
Download http://nssm.cc/download/?page=download
Unpack it (lets say C:\NSSM)
Create a batch file ( lets say C:\Fedena\StartFedena.bat)
Edit the batch file ( right click on the bat file and click Edit)
Past the following code (change the paths accordingly)
********************************** (without the stars and this comment)
cd \
cd Fedena
mongrel_rails start -e production
Note: If you want to start it as development mode remove -e production from the last line
Open CMD
Type cd\
Type cd NSSM
depending on the system type: "cd win32" ot "cd win64"
9.Type in the cmd : "nssm install"
A modal window will pop-up
Click Browse
Navigate to the location where the batch file is and select it;
Leave options empty
Service name "Fedena"
Install Service
Go to "Services" (usually under Control Panel\System and Security\Administrative Tools)
Start Services
You should find service named "Fedena"
Start Service
Navigate to http://example.com:3000 and Fedena should be up
The service should be already set as automatic so if the server is restarted Fedena will come up automatically.
If you need to bounce the application just restart the Fedena Service.
That is,
Thank you