DEV Community

Cover image for How fast to install Linux on any PC?
Serhii Korol
Serhii Korol

Posted on

How fast to install Linux on any PC?

I'll show you how fast it is to install Debian Linux distributive on your PC without using a virtual machine.
You need only the Docker Desktop application. Open and run it.
Open Terminal and run this command:

docker run \
    --rm \
    -ti \
    --hostname webbian \
    --name webbian \
    -p 127.0.0.1:4900:4900 \
    -p 127.0.0.1:5900:5900 \
    -v ./data/home/root:/root \
    -v ./bin:/scripts/bin \
    -e BOOT_SCRIPT=/scripts/bin/boot.sh \
    -e X11_SCRIPT=/scripts/bin/x11.sh \
    -e GEOMETRY=1920x1080 \
    -e PASSWORD=ZmFkNzkyZTVhNzkyYzhlMzQ1NGY2YjdkN \
    nowsci/webbian:latest
Enter fullscreen mode Exit fullscreen mode

There are several parameters:

  1. GEOMETRY is a required parameter for setting the size of a window. If you want the window to autoscale, you need to use a ?resize=remote web parameter.
  2. PASSWORD is needed to enter the system.
  3. BOOT_SCRIPT and X11_SCRIPT are optional parameters needed for additional system settings and window start.

You can enter the system through your browser by clicking the link http://localhost:4900. All browsers are supported. If you go by this URL, you'll get a list of the files and folders. Technically, we use Debian, but not directly. These files and folders are from the VNC client. VNC is virtual network computing. It uses JavaScript.

files

You can enter the system in full or lite mode by visiting the link http://localhost:4900/vnc.html?resize=remote. Here, you'll get VNC settings.

vnc

If you go to this link ' http://localhost:4900/vnc_lite.html?resize=remote ' in lite mode, you'll see only the password form.

lite

Please enter the password that we used earlier. If you choose full mode, you'll see this window.

full

If you choose the lite mode, you'll get this window.

lite

As mentioned earlier, you can set up settings using optional parameters. By default, these settings are empty. You can also use docker-compose to set up an image.

services:

  webbian:
    image: nowsci/webbian:latest
    container_name: webbian
    hostname: webbian
    ports:
      - 127.0.0.1:4900:4900
      - 127.0.0.1:5900:5900
    volumes:
      - ./data/home/root:/root \
      - ./bin:/scripts/bin
    environment:
      - BOOT_SCRIPT=/scripts/bin/boot.sh
      - X11_SCRIPT=/scripts/bin/x11.sh
      - GEOMETRY=1920x1080
      - PASSWORD=ZmFkNzkyZTVhNzkyYzhlMzQ1NGY2YjdkN
    restart: unless-stopped
Enter fullscreen mode Exit fullscreen mode

If you need SSL, you can adjust the Nginx server:

server {
        listen 443 ssl;
        server_name webbian.domain.ext;
        gzip off;
        ssl_certificate /letsencrypt/live/domain.ext/fullchain.pem;
        ssl_certificate_key /letsencrypt/live/domain.ext/privkey.pem;
        ssl_session_cache shared:SSL:10m;
        ssl_protocols TLSv1.2;
        ssl_ciphers HIGH:!aNULL:!MD5;
        modsecurity on;
        add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
        client_max_body_size 20M;

        location / {
                autoindex off;
                index vnc.html;
                # Optional extra security
                # auth_basic "Administrator Area";
                # auth_basic_user_file /etc/nginx/htpasswd/novnc.htpasswd;
                proxy_pass http://webbian:4900/;
                proxy_set_header Host $host;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
                proxy_buffering off;
                proxy_connect_timeout 43200000;
                proxy_send_timeout    43200000;
                proxy_read_timeout    43200000;
                proxy_redirect off;
                proxy_set_header Proxy "";
        }
}
Enter fullscreen mode Exit fullscreen mode

But if you need a more specific configuration, for instance, you need more preinstalled applications, you can build your own image with the desired settings. This source is here: https://github.com/Fmstrat/webbian/tree/main

See you later. Happy coding!😎

Buy Me A Beer

Top comments (0)