I would like to open 2 chromium instances from terminal but this does not work. I'm currently using raspberry
chromium-browser --window-position=0,0 chromium-browser --window-position=1920,0
You have to execute the following in the terminal:
sudo chromium-browser --no-sandbox & sudo chromium-browser --no-sandbox &
--no-sandbox is necessary on the Raspberry Pi.
Related
I just start learning laravel, and follow the tutorial from https://laravel.com/docs/8.x/installation "Getting started on Windows" .
I manage to install Docker Desktop and COnfigured to use WSL2 Backend.
When I run the command curl -s https://laravel.build/example-app | bash to create laravel application directory from cmd, this warning come out Docker is not running.
I run curl using command prompt. (cmd).
Update:
So, I run the command in Windows Terminal:.
PS E:\Play> curl -s https://laravel.build/example-app | bash
Here is the response I get:
cmdlet Invoke-WebRequest at command pipeline position 1
Supply values for the following parameters:
Uri:
Any Idea what to do?
Try to explicitly enable integration with your distro in Docker settings:
After that relaunch your WSL2 terminal & try again. That should help.
You can also open https://laravel.build/example-app in a browser & check what commands the script is running: and run them manually to check the output for any errors.
For those who are using Ubuntu or Debian can check this guide out on how to install and configure Docker.
sudo snap install docker
sudo usermod -aG docker $(whoami)
sudo chmod 666 /var/run/docker.sock
You need to install a linux distro, and then in Windows Terminal create a new tab for the linux distro and run the command there, not in a windows powershell tab.
Make sure that you are running curl command on your distro. Use Windows Terminal app and open a new tab as WSL2 (your distro).
sudo chmod 666 /var/run/docker.sock
I guess you are using ubuntu or debian.
chmod will do the trick here.
I have a Dockerfile written as below:
FROM joesan/raspi_opencv_3:latest
RUN apt-get update
RUN sudo apt-get install --no-install-recommends xserver-xorg
RUN sudo apt-get install --no-install-recommends xinit
RUN apt-get install -qqy x11-apps
RUN mkdir -p /raspi_motion_detection/project
WORKDIR /raspi_motion_detection/project
COPY ./ $WORKDIR/
COPY ./requirements.txt $WORKDIR/
ADD . $WORKDIR
CMD xclock
I have a Raspberry Pi to which I ssh from my Mac (running High Sierra).
Here is what I do:
I ssh into the RaspPi from my Mac
I execute the docker command using:
docker run -ti --device=/dev/vcsm \
--device=/dev/vchiq \
-e DISPLAY=$DISPLAY:0 \
-e XAUTHORITY=/.Xauthority \
-v /tmp/.X11-unix:/tmp/.X11-unix \
joesan/motion_detector
I get an error message as below:
Error: Can't open display: localhost:11.0:0
But when I just run xclock directly on the ssh terminal, I can see that the xclock window opens up.
So I could not understand why running xclock from within a Docker container would prevent the display port being opened? Any reasons? I also came across this post here and followed what has been described there, but i could not get it to work!
https://medium.com/#dimitris.kapanidis/running-gui-apps-in-docker-containers-3bd25efa862a
A bit simplified: Each docker container runs inside the docker daemon, which basically provides a stripped down os to each container. That os has no window manager.
That is why the command xclock inside a docker container exits with an error.
When you connect via ssh to your raspberry pi and call xclock it is executed inside the raspberry's os (propably raspian), which has a running window manager.
Ok! So I thinkI found the solution to my problem! Here is what I did!
Re-installed Raspberry Stretch Lite on my SD card. The old one seems to have gotten some stale files! You can skip this step, but for me there was some corrupt files on the old installation, so I decided to get a fresh install!
On my Raspberry Pi, run the following command:
xauth list
I copy the cookie locally to a text editor as I need it later!
Removed the xclock command from the Dockerfile that I originally had!
Build the Dockerfile using the following command:
docker run -it --net=host --device=/dev/vcsm --device=/dev/vchiq -e
DISPLAY -v /tmp/.X11-unix joesan/motion_detector bash
Notice that I'm running a bash command to my Docker run so that I can get a basj prompt from the running image!
The result of step 3 would give me a bash prompt from the container that I just ran at step 3
I need to now install xauth in the image
apt-get install xauth
I then add the xauth cookie from step 0
It is after this Bang! I got what I want!
I wrote a bash file to start an emulator and install apk with the commands,
emulator -avd emulatorName
adb wait-for-device
adb install OpenManager.apk
but when i run the file from terminal it starts the emulator and it hangs there it doesn't execute the command to install the apk. But when i close the emulator then it execute the install command. Please, can someone help on how to do that.
Add an & to run the emulator process in the background:
emulator -avd emulatorName & adb wait-for-device && sleep 5 && adb install OpenManager.apk
and the && to run the following command if the previous succeeded.
I try to run firefox in headless mode for selenium.
$xvfb-run firefox seems to work.
I run firefox through selenium so i cannot run xvfb-run directly.
So i start
Xvfb :1 -screen 0 1024x768x24 &
and then
set DISPLAY:=1
env DISPLAY:=1
Still when i run firefox i get
Error: no display specified
I run on centos 6 and firefox 38 ESR.
What can be done?
can you try that?
export DISPLAY=:1
start firefox with --display arg
/usr/bin/firefox --display=:1
I am trying to setup a linux box (no display connected) to run as a selenium server. If I connect a monitor and login on the box then I can run the selenium tests no problem. If I try to run the tests via ssh then the tests fail with
Failed to start new browser session, shutdown browser and clear all session data
java.lang.RuntimeException: Timed out waiting for profile to be created!
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.waitForFullProfileToBeCreated(FirefoxChromeLauncher.java:360)
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.populateCustomProfileDirectory(FirefoxChromeLauncher.java:114)
I think it has something to do with the display's absence / presence. Any ideas?
PS the browser is firefox 5, the OS is Ubuntu 11.04
I got it to work by using xvfb. So first install xvfb:
sudo apt-get install xvfb
then run it
Xvfb :99 -ac
and then start the selenium server
DISPLAY=:99 java -jar selenium-server-standalone-2.4.0.jar
Here is my answer.
You get this error because there is no monitor to open firefox on, it is getting confused.
Install Xvfb, which pretends to be a monitor, but doesn't show up anywhere.
sudo apt-get install xvfb
If you want less errors add these fonts, but those warning aren't important.
sudo apt-get install xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic
Then start it running and set your display to something the system won't use. Here is what I do, remeber the & makes the terminal run something in the background.
Xvfb :99 -ac &
export DISPLAY=:99
firefox &
Also I was having problems with a ruby on rails server disconnecting when I quit the ssh terminal. To fix that problem use Screen. Screen runs another terminal without being affected by the ssh.
sudo apt-get install screen
Then just start screen before you you do the stuff above.
screen
To get out of the current screen window just click "Ctrl + A" and to get back in type screen -r.
There is a good way to test using imagemagick screen shoot
Install mozilla firefox headless(no GUI)
yum install xorg-x11-server-Xvfb.x86_64 xfonts-base xfonts-75dpi xfonts-100dpi firefox ImageMagick.x86_64
Starts firefox on virtual gui
DISPLAY=:1 firefox http://google.com &
– test and check
Xvfb :1 -screen 1 1024x768x24 &
ps -ef |grep firefox
Uses imagemagic to get a printscreen, to make sure its working.
DISPLAY=:1 import -window root google.com.png
(Optional) Set proxy in firefox profile
vi /root/.mozilla/firefox/ns11i9xo.default/prefs.js
user_pref(“network.proxy.http”, “proxyserver”);
user_pref(“network.proxy.http_port”, 8080);
user_pref(“network.proxy.no_proxies_on”, “localhost, 127.0.0.1, 172.17.0.0/16, 10.5.0.0/16″);
http://felipeferreira.net/?p=1220