Start Chromium in Xvfb display: cannot start document portal: dial unix /run/user/0/bus: connect: permission denied - chromium

I want to run some tests with latest Chromium but experiencing errors.
I set up a new ubuntu 20 server without any additional packages.
Install chromium with apt install chromium-browser
Installed xvfb server
Created a display with
export DISPLAY=:2
Xvfb $DISPLAY -screen 0 1024x768x16 &
started chromium with
chromium-browser https://google.com
Error log shows:
2022/10/09 15:21:38.283814 cmd_run.go:1055: WARNING: cannot start document portal: dial unix /run/user/0/bus: connect: permission denied
mkdir: cannot create directory '/run/user/1000': Permission denied
[10264:10428:1009/152139.132312:ERROR:bus.cc(399)] Failed to connect to the bus: Failed to connect to socket /run/user/0/bus: Permission denied
[10264:10428:1009/152139.132601:ERROR:bus.cc(399)] Failed to connect to the bus: Failed to connect to socket /run/user/0/bus: Permission denied
[10264:10428:1009/152139.170741:ERROR:bus.cc(399)] Failed to connect to the bus: Failed to connect to socket /run/user/0/bus: Permission denied
[10264:10428:1009/152139.170913:ERROR:bus.cc(399)] Failed to connect to the bus: Failed to connect to socket /run/user/0/bus: Permission denied
Any hints how to fix that?

Related

Fails to execute command

enter image description here
curl: (28) Failed to connect to raw.githubusercontent.com port 443 after 130114 ms: Couldn't connect to server
Getting this kind of error whenever I try to install some applications or oh-my-zsh/fish
same happens with the wget option as well
OS: ArchLinux

Why does Rabbitmq server fail to log in?

I use rabbitmq-server in Ubuntu 18.04.
I install rabbitmq-server through "sudo apt-get install rabbitmq-server"
And i run rabbitmq-server.service through "sudo systemctl start rabbitmq-server.service"
then, i checked "netstat -ntlp", cause port open(5672, 15672).
However, the following error log occurs.
=ERROR REPORT==== 24-Jan-2022::13:52:48 ===
Error on AMQP connection <0.5608.0> (127.0.0.1:45718 -> 127.0.0.1:5672, state: starting):
PLAIN login refused: user 'test_rabbit' - invalid credentials
What is the reason for this error and is there a solution to it?

GCP: how to use CLI to connect with SSH to newly created VM?

I think I'm missing one step in the script below.
The first time I run it, the VM gets created just fine, but the connection is refused. It continues to be refused even if I wait ten minutes after creating the VM.
However, if I use the GCP console to connect manually "Open in browser window", I get the message "Transferring SSH keys...", and the connection works. After this step, the script can connect fine.
What should I add to this script to get it to work without having to manually connect from the console?
#!/bin/bash
MY_INSTANCE="janne"
MY_TEMPLATE="dev-tf-nogpu-template"
HOME_PATH="/XXX/data/celeba/"
# Create instance
gcloud compute instances create $MY_INSTANCE --source-instance-template $MY_TEMPLATE
# Start instance
gcloud compute instances start $MY_INSTANCE
# Copy needed directories & files
gcloud compute scp ${HOME_PATH}src/ $MY_INSTANCE:~ --recurse --compress
gcloud compute scp ${HOME_PATH}save/ $MY_INSTANCE:~ --recurse --compress
gcloud compute scp ${HOME_PATH}pyinstall $MY_INSTANCE:~
gcloud compute scp ${HOME_PATH}gcpstartup.sh $MY_INSTANCE:~
# Execute startup script
gcloud compute ssh --zone us-west1-b $MY_INSTANCE --command "bash gcpstartup.sh"
# Connect over ssh
gcloud compute ssh --project XXX --zone us-west1-b $MY_INSTANCE
The full output of this script is:
(base) xxx#ubu-dt:/XXX/data/celeba$ bash gcpcreate.sh
Created [https://www.googleapis.com/compute/v1/projects/XXX/zones/us-west1-b/instances/janne].
NAME ZONE MACHINE_TYPE PREEMPTIBLE INTERNAL_IP EXTERNAL_IP STATUS
janne us-west1-b n1-standard-1 XXX XXX RUNNING
Starting instance(s) janne...done.
Updated [https://compute.googleapis.com/compute/v1/projects/xxx/zones/us-west1-b/instances/janne].
ssh: connect to host 34.83.3.161 port 22: Connection refused
lost connection
ERROR: (gcloud.compute.scp) [/usr/bin/scp] exited with return code [1].
ssh: connect to host 34.83.3.161 port 22: Connection refused
lost connection
ERROR: (gcloud.compute.scp) [/usr/bin/scp] exited with return code [1].
ssh: connect to host 34.83.3.161 port 22: Connection refused
lost connection
ERROR: (gcloud.compute.scp) [/usr/bin/scp] exited with return code [1].
ssh: connect to host 34.83.3.161 port 22: Connection refused
lost connection
ERROR: (gcloud.compute.scp) [/usr/bin/scp] exited with return code [1].
ssh: connect to host 34.83.3.161 port 22: Connection refused
ERROR: (gcloud.compute.ssh) [/usr/bin/ssh] exited with return code [255].
ssh: connect to host 34.83.3.161 port 22: Connection refused
ERROR: (gcloud.compute.ssh) [/usr/bin/ssh] exited with return code [255].
Edit: adding gcloud version info
(base) bjorn#ubu-dt:/media/bjorn/data/celeba$ gcloud version
Google Cloud SDK 269.0.0
alpha 2019.10.25
beta 2019.10.25
bq 2.0.49
core 2019.10.25
gsutil 4.45
kubectl 2019.10.25
The solution I found is this: wait.
For OS login, SSH starts working about 20 seconds after the instance is started.
For non-OS login, it takes about a minute.
So I just added this after gcloud compute instances start $MY_INSTANCE
sleep 20s
When you connect through Console it manages the keys for you.
Your last comment leads me to believe that when you connect from console you are generating an SSH key and it somehow allows you to run the script, I would recommend you to take a look at how to manage SSH keys in metadata and creating your own SSH key to access through the SDK.
If outside of the script through the SDK you cannot directly SSH either then I assume that it's because of the same reason of the generated key.
Also please make sure that when using the SDK the service account has the correct permissions.
Let me know.

vscode insiders connection error after update

Vscode insiders stopped to work with remote today morning after (unavoidble) update. It doesn't show remote directory, saying
Connection error: Unauthorized client refused.
and
Failed to connect to the remote extension host server (Error:
Connection error: Unauthorized client refused.)
Deletion of all remote vscode files and killing vscode processes didn't help.
The following transcript can be seen in Output tab:
remote-ssh#0.44.0
linux x64
SSH Resolver called for "ssh-remote+myserver", attempt 1
SSH Resolver called for host: myserver
Setting up SSH remote "myserver"
Using commit id "MYHASH" and quality "insider" for server
Testing ssh with ssh -V
ssh exited with code: 0
Got stderr from ssh: OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n 7 Dec 2017
Install and start server if needed
> Found existing installation at /home/dimskraft/.vscode-server-insiders/bin/MYHASH...
> Found running server...
>
> *
> * Reminder: You may only use this software with Visual Studio family products,
> * as described in the license (https://go.microsoft.com/fwlink/?linkid=2077057)
> *
>
> Checking server status with wget
> ==MY-GUID==
"install" terminal command done
Received install output: ==MY-GUID==
Server is listening on port 35693
Spawning tunnel with: "ssh" -L 127.0.0.1:35693:127.0.0.1:35693 -o ConnectTimeout=15 "myserver" bash << 'EOSSH'
echo -e 'Connected to SSH Host - Please do not close this terminal' && sleep infinity
EOSSH
> Connected to SSH Host - Please do not close this terminal
Spawned SSH tunnel between local port 35693 and remote port 35693
Waiting for ssh tunnel to be ready
Tunneling remote port 35693 to local port 35693
Resolved "ssh-remote+myserver" to "127.0.0.1:35693"
------
Downgrading to 1.36.0-insider helped

After setup password-less login, I still got permission denied error while running a script to login

I have already setup the password-less login to localhost via ssh, and it works and doesn't need me to enter any password.
justinwu#ubuntu:~$ ssh root#localhost
Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-110-generic x86_64)
* Documentation: https://help.ubuntu.com/
2 packages can be updated.
0 updates are security updates.
New release '16.04.2 LTS' available.
Run 'do-release-upgrade' to upgrade to it.
Last login: Tue Mar 7 10:08:22 2017 from localhost
But while running one script and it needs to login as root via ssh, it returns the error 'Permission denied (publickey)'.
...
Launching 20 processes.
Starting test client: 0 Host: localhost Workload: VDI Workdir: /mnt/share
Permission denied (publickey).
I don't know why the script cannot automatically login via root without entering the password.
Please help! Thanks!