Se afișează postările cu eticheta Arch Linux. Afișați toate postările
Se afișează postările cu eticheta Arch Linux. Afișați toate postările

miercuri, 20 august 2025

Debugging Hotel Wi-Fi Login on Arch Linux (and a Docker Gotcha)

Recently, while staying at a hotel, I tried connecting my Arch Linux laptop to the Wi-Fi. As usual, the network redirected to a captive portal login page. But this time, things didn’t work as expected.

First, I checked the captive portal detection URL with:

curl -I http://detectportal.firefox.com

That gave me a gateway URL like:

http://127.17.0.1/login.php

But when I tried to open it in a browser, I kept getting “Unable to connect”.

At first, I thought the hotel’s Wi-Fi was broken. Then I noticed something odd: the IP address started with 127.17…. That reminded me of Docker, since I had seen a similar subnet in docker info.

So I ran:

ip addr show

And sure enough, I saw this:

docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
    link/ether 02:42:84:b7:e7:1e brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever
    inet6 fe80::42:84ff:feb7:e71e/64 scope link proto kernel_ll

Aha! Docker was hijacking the IP range 172.17.x.x, which happened to be the same network the hotel’s captive portal was using.

To fix it, I temporarily disabled the Docker bridge:

sudo ip link set docker0 down
sudo ip addr flush dev docker0

After that, I could finally access:

http://172.17.0.1/login.php

and log in to the Wi-Fi.

joi, 24 iulie 2025

VS Code "Open Folder" Does Nothing on Arch Linux (LXQt)

I installed Visual Studio Code on Arch Linux with LXQt, but clicking "Open Folder" did nothing — no error, no folder picker, just silence.

To debug, I ran:

journalctl -f

Then clicked "Open Folder" again. This time, I saw the error:

xdg-desktop-portal: Backend call failed: Could not activate remote peer 'org.freedesktop.impl.portal.desktop.gtk': activation request failed: unit is masked

Fix:

systemctl --user unmask xdg-desktop-portal-gtk.service

systemctl --user enable --now xdg-desktop-portal-gtk.service

vineri, 7 februarie 2025

Kitty SSH Issue: No Output in top and htop Error

With Kitty, the top command in SSH shows nothing. I tried htop, but it returned an error.

What I did: Googled the issue and looked for a better solution.

Solution 1: Directly in the SSH terminal session:

TERM=xterm top

Solution 2: Add to local .ssh/config file

SetEnv TERM=xterm

duminică, 26 ianuarie 2025

How do I make a Docker container start automatically on system boot?

I have a Redis/Redis Stack container that I would like to start automatically at system boot. Since it is already running, I needed command

docker update --restart=always aa6daa0d965e
However, if it is starting for the first time, I use command
docker run -d -p 6379:6379 --restart=always redis/redis-stack-server

There is also a third option: transform the container into a service and manage it with systemctl: https://stackoverflow.com/a/39493500/2806801.

P.S. If you need to temporarily stop the Redis/Redis Stack container:

docker update --restart=no aa6daa0d965e

docker stop aa6daa0d965e

 

duminică, 19 ianuarie 2025

java.net.UnknownHostException: host.docker.internal

There is no host.docker.internal provided by default on Linux. On macOS and Windows, Docker Desktop creates a virtual network bridge and provides host.docker.internal as a hostname to allow containers to communicate with the host system. However, Linux uses a different approach for container networking, so host.docker.internal is not automatically provided.

One solution is to use the host's IP address. Run the command ip addr show docker0 to find the IP address of the Docker bridge network. It is usually 172.17.0.1.


 

Downgrading Automatically Upgraded Packages in Arch Linux

 

After the last upgrade of Arch Linux using pacman -Syu, PostgreSQL failed to start, displaying an error indicating that the database was in an outdated format. This meant that I had inadvertently upgraded PostgreSQL from one major version to another without first exporting the database as a precaution.

Fortunately, I found this article: How to Downgrade Packages in Arch Linux, and the following steps resolved my problem:

yay -S downgrade

sudo downgrade postgresql    

duminică, 12 ianuarie 2025

OpenVPN Connecting but No Internet Access on Arch Linux

 Here is an answer: AskUbuntu: OpenVPN Connecting but No Internet Access

On my system running Cinnamon with Network Manager, I followed these steps:

  1. Open Network Settings.
  2. Edit the settings for the specific VPN connection.
  3. Under IPv4, scroll down and check the option "Use this connection only for resources on its network".
  4. Under IPv6, scroll down and check the option "Use this connection only for resources on its network".
  5. Click Apply.

This resolved the issue for me.

sâmbătă, 11 ianuarie 2025

No Password Prompt for VPN? How I Fixed It on Arch Linux

Yesterday, I upgraded packages on my Arch Linux system. Today, I noticed that the VPN refused to connect. There were no error messages, but the dialog to enter the password didn’t appear. I discovered that Arch Linux (and possibly most modern Linux distributions) no longer uses `/var/log/syslog` or `/var/log/messages`.  
To debug, I used the following command (https://wiki.archlinux.org/title/Systemd/Journal#Filtering_output):  

journalctl --since "2 min ago"
I found the error:  
Jan 10 15:45:56 myarch NetworkManager[487]: <warn> ...  secrets: failed to request VPN secrets #3: No agents were available for this request.


I searched Google for the error and came across these helpful links:  
- Unix Stack Exchange: Failed to request VPN secrets #3 
- Arch Linux Forums: Failed to request VPN secrets 
 

The solution I found was to "Store the password for all users."  In my case, this translates to the following steps:  
1. Open Network Settings.  
2. Edit the VPN connection.  
3. Go to the Identity section.  
4. Click the dropdown to the right of the password field.  
5. Select Store the password for all users.  
Additionally, I discovered that logs specific to NetworkManager can be viewed with:  

journalctl -u NetworkManager

I also found that I can see all NetworkManager connections using nmcli command or listing the content of the directory /etc/NetworkManager/system-connections/. Then try to start that connection:

nmcli conn up <my-vpn-config>

Then I saw this message

You need to authenticate to access the Virtual Private Network “my-vpn-config”.
Warning: password for 'vpn.secrets.password' not given in 'passwd-file' and nmcli cannot ask without '--ask' option.
Error: Connection activation failed: No valid secrets
Hint: use 'journalctl -xe NM_CONNECTION=453a0f43-dc10-4557-b524-a762c99833d4 + NM_DEVICE=wlp3s0' to get more details. 
Thus
nmcli conn up <my-vpn-config> --ask

also solved the issue.

A more general solution

sudo pacman -S gnome-keyring