Categories
Uncategorized

How to install Kasm

Installing Kasm is very easy if you have a server or vm with anufe specks you are going to need 2+ cores 4+gb of ram and a swap file with 1+gb for every user that you plan to have logged in.

after you get the server os installed you will need to make the the swap file

sudo fallocate -l 4g /mnt/4GiB.swap
sudo chmod 600 /mnt/4GiB.swap
sudo mkswap /mnt/4GiB.swap
sudo swapon /mnt/4GiB.swap

now that you have the sawp file made it is time to install Kasm

cd /tmp
curl -O https://kasm-static-content.s3.amazonaws.com/kasm_release_1.12.0.d4fd8a.tar.gz
tar -xf kasm_release_1.12.0.d4fd8a.tar.gz
sudo bash kasm_release/install.sh

when you log into the web browser you are going to need to use https not http

Categories
Uncategorized

How to host a sandboxed web browser with docker

Here are the commands to install Docker, and docker-compose here at the start of 2023

Update the apt package index

sudo apt-get update

Install Docker’s dependencies

sudo apt-get install ca-certificates curl gnupg

Add Docker’s official GPG key

sudo mkdir -m 0755 -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

Add Docker’s stable repository to your system’s apt sources list

echo \
  "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Update the apt package index (again)

sudo apt update

Install Docker

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Verify that Docker is installed correctly

docker --version

Verify that Docker Compose is installed correctly

docker compose --version

now that we have docker installed it is time to start making the files that are needed to bulid the webpage and and the web browsers

to do this we first need to make a folder

mkdir webbrowser

no we need to make a file called docker-compose.yaml

nano docker-compose.yaml
version: '3'
services:

  notes:
      image: nginx:latest
      ports:
        - "80:80"
      volumes:
        - ./nginx.conf:/etc/nginx/conf.d/default.conf
        - ./:/usr/share/nginx/html/

  firefox:
    image: kasmweb/firefox:1.13.0-rolling
    ports:
      - "4000:6901"
    environment:
      - VNC_PW=test
    shm_size: 512m

  chrome:
    image: kasmweb/chrome:1.13.0-rolling
    ports:
      - "4001:6901"
    environment:
      - VNC_PW=test
    shm_size: 512m

  brave:
    image: kasmweb/brave:1.13.0-rolling
    ports:
      - "4002:6901"
    environment:
      - VNC_PW=test
    shm_size: 512m

  tor-browser:
    image: kasmweb/tor-browser:1.13.0-rolling
    ports:
      - "4003:6901"
    environment:
      - VNC_PW=test
    shm_size: 512m

  edge:
    image: kasmweb/edge:1.13.0-rolling
    ports:
      - "4004:6901"
    environment:
      - VNC_PW=test
    shm_size: 512m

  chromium:
    image: docker pull kasmweb/chromium:1.13.0-rolling
    ports:
      - "4005:6901"
    environment:
      - VNC_PW=test
    shm_size: 512m

  firefox:
    image: kasmweb/firefox:1.13.0-rolling
    ports:
      - "4000:6901"
    environment:
      - VNC_PW=test
    shm_size: 512m

  chrome:
    image: kasmweb/chrome:1.13.0-rolling
    ports:
      - "4001:6901"
    environment:
      - VNC_PW=test
    shm_size: 512m

  brave:
    image: kasmweb/brave:1.13.0-rolling
    ports:
      - "4002:6901"
    environment:
      - VNC_PW=test
    shm_size: 512m

  tor-browser:
    image: kasmweb/tor-browser:1.13.0-rolling
    ports:
      - "4003:6901"
    environment:
      - VNC_PW=test
    shm_size: 512m

  edge:
    image: kasmweb/edge:1.13.0-rolling
    ports:
      - "4004:6901"
    environment:
      - VNC_PW=test
    shm_size: 512m

  chromium:
    image: kasmweb/chromium:1.13.0-rolling
    ports:
      - "4005:6901"
    environment:
      - VNC_PW=test
    shm_size: 512m

press control x to save the file

now we need to make a config file for nginx to host the notes page

nano nginx.conf

server {
    listen 80;

    location / {
        root /usr/share/nginx/html;
        index index.html;
    }
}

last we need to wright the html for the notes page in a file names index.html

nano index.html
<!DOCTYPE html>
<html>
<head>
	<title>Testing Browsers</title>
</head>
<body>
	<header>
		<h1>Testing Browsers</h1>
	</header>
	<article>
		<h2>username = kasm_user</h2>
		<h2>password = test</h2>
		<p>you will need to use https:// infront of all ip addres and ports</p>
	</article>
	<article>
		<h2>firefox</h2>
		<p>port:4000</p>
	</article>
	<article>
		<h2>chrome</h2>
		<p>port:4001</p>
	</article>
	<article>
		<h2>brave</h2>
		<p>port:4002</p>
	</article>
	<article>
		<h2>tor-browser</h2>
		<p>port:4003</p>
	</article>
	<article>
		<h2>edge</h2>
		<p>port:4004</p>
	</article>
	<article>
		<h2>chromium</h2>
		<p>port:4005</p>
	</article>
	<footer>
	</footer>
</body>
</html>

now that you have all the files made it is time to start the project up

docker-compose up -d

to go to your webbrowser and enter the server ip address and the port of the browser that you are looking to test with

https://[server ip]:[port]
https://youtu.be/IoCxnlkAPwI
Categories
Uncategorized

LXD Commands Cheat Sheet

Install LXD on Ubuntu

sudo apt install lxd-installer

LIST ALL LXD IMAGES ON A HOST
lxc image list

CREATE A CONTAINER FROM AN IMAGE
lxc launch images:{distro}/{version}/{arch} {container-name-here}

View a list of IMAGES
lxc image list

lxc delete {fingerprint}

CONTAINER
start
lxc start {ct name}

restart
lxc restart {ct name}

stop
lxc stop {ct name}

delete
lxc delete {ct name}

CREATE A CUSTOM IMAGE FROM A CONTAINER

lxc stop {ct name}
lxc publish {ct name} –alias {alias name} description=”{ct description}”

CREATE A CONTAINER USING AN IMAGE ALIAS
lxc launch {alias name} {ct name}

SNAPSHOT AN IMAGE
lxc snapshot {alias name}

INSPECT AN IMAGE
lxc image info {image name}

EXPORT THE IMAGE
lxc image export {image name} {path to store}

IMPORT THE IMAGE ON A DIFFERENT SERVER
lxc image import {image file name} –alias={image name}

https://youtu.be/FPCCA4c3r-0