Skip to content

cartpauj/localwp-chromebook-crostini

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

LocalWP for Chrome OS Crostini

Requirements

  • Must use the primary penguin Linux container "penguin"

Setup Steps

1. Find Your Username

echo $USER
# or
whoami
# or
users

2. Install Required Packages and Fix Polkit Authentication

First, install the required packages:

sudo apt update && sudo apt install -y wget dpkg libaio1 libncurses5 libnss3-tools policykit-1 policykit-1-gnome libcap2-bin

Then fix Polkit authentication by replacing YOUR_USERNAME with your actual username from step 1:

sudo tee /etc/polkit-1/rules.d/99-localwp-allow.rules > /dev/null << EOF
polkit.addRule(function(action, subject) {
    if (action.id == "org.freedesktop.policykit.exec" && subject.user == "YOUR_USERNAME") {
        return polkit.Result.YES;
    }
});
polkit.addRule(function(action, subject) {
    if (action.id.indexOf("org.freedesktop") == 0 && subject.user == "YOUR_USERNAME") {
        return polkit.Result.YES;
    }
});
polkit.addRule(function(action, subject) {
    if (subject.user == "YOUR_USERNAME" && subject.local) {
        return polkit.Result.YES;
    }
});
EOF

sudo pkill -HUP polkitd

Testing Polkit Configuration

After killing polkitd, you can test if the polkit configuration is working without requiring a password:

# Test if polkit allows actions without password prompts
pkexec echo "Polkit configuration is working correctly"

If configured correctly, this should display the message without prompting for a password.

3. Restart Linux Environment

Either restart your Chromebook or right-click the Linux icon in the shelf and choose "Shutdown Linux".

4. Install LocalWP

Download and install LocalWP after the restart:

# Step 1: Download LocalWP
wget -O local-linux.deb "https://cdn.localwp.com/stable/latest/deb"

# Step 2: Install LocalWP
sudo dpkg -i local-linux.deb

5. Configure Router Mode

In LocalWP Preferences, set Router Mode to "localhost".

Your LocalWP sites will now be accessible from Chrome OS browser via http://localhost:PORT/

Updating LocalWP

To update LocalWP to the latest version:

1. Download Latest Version

wget -O local-linux.deb "https://cdn.localwp.com/stable/latest/deb"

2. Install Update

sudo dpkg -i local-linux.deb

3. Clean Up

rm local-linux.deb

The update process will preserve your existing sites and settings. No additional configuration is required after updating.