Building a minimal debian for i2p use in qemu vm.WIP + usblivebuild

HowTos, FAQs, Tips & Tricks, & Guides
Post Reply
Posts: 36
Joined: 12 Feb 2022 02:58

Building a minimal debian for i2p use in qemu vm.WIP + usblivebuild

Post by robabok978 »

Building a minimal debian for i2p use in qemu vm.WIP

Still a wip or playwith. Just some minimal things i use and more or less just a way to bring the user to the i2p ready browsing state.
I made some scripts(lol) and a tutorial in somewhat the direction i mentioned in my other thread (http://i2pforum.i2p/viewtopic.php?t=1178).
I still don't know if this will help some to install a vm for i2p usage or it will fail because something needed is missing for good usage (like qemu copy&paste enabled, graphic performance etc.)
I hope that it will bring more i2p apps together and so more testing and usage of them for common users.
I added some videos which show the user what will happened and would like to have it for every install.

I only tested this on a linux host. So everything for the windows host is missing. Like winscp, sshfs for win, wget for win, qemu for win. These should be later in the install folder too.
Some things i haven't added are the live user with its home on tmpfs, scripts for making own live usb from the actual system with linux live kit, something i2p informative for the desktop background, videos for the apps...
Some things for future testing are i2pchat, railroad, i2ptor-manager, cryptowallets. And some apps i still haven't decided to use, like midori or in general another browser for the clearnet use, like for the app website. I use netsurf, but it is unusable for most sites. And there is the fluxbox config to play with, for having a autostart in caja or switching users instead of exit in fluxbox. Menu is also wip and not fixed in the structure.

There were also some surprise for the luks password use. Normally there would have been 2 password asked for at startup, as there are 2 partitions encrypted. But it only asked at first boot for two. After that only one password is needed. Maybe as it is the same password or because of the setup it has spared it. Don't know, but nice.

I think that with scripts/same system it is somewhat easier for others to customize/use this. So if you have some ideas for comfort, security, better scripts, other folder structure or whatever you think others could benefit, do post/paste them if you like.

Scripts for ufw in different security scenarios, privoxy, cleaning besides bleachbit.. could be useful.

There are many things in qemu i still don't know/haven't tested, like ramdisk usage for snapsots, its network config, if you have more knowledge, post.

Ideal easy would be a ready to use system with apps and bundled images. Size is there the problem. There are ways like undersizing the partition or compress the images (both 12gb raw images,comp to 6gb) and let them decompress on the users system. There are ways to change the luks partitions password, i haven't tested yet, but if it works, it is possible to have a pre encrypted image distributed, i guess.

Usage videos:
http://o7jgnp7bubzdn7mxfqmghn3lzsjtpgkb ... l.h264.mp4

http://o7jgnp7bubzdn7mxfqmghn3lzsjtpgkb ... l.h264.mp4

http://o7jgnp7bubzdn7mxfqmghn3lzsjtpgkb ... l.h264.mp4

all in one zip clearnet:

And here is the tutorial:

Create 2 qemu harddisk images in raw format or qcow2 format (better for snapshots)
system.img with /boot ext4 and / with luks/btrfs
home.img with /home with luks/btrfs

# Script in InstallRoot:
qemu-img create -f raw ./system.img 12G
qemu-img create -f raw ./home.img 12G

Start the install with the 2 images, the install iso and the qemu port forwarding for ssh access from the host to the guest with ssh i2p@ -p 8888

# Script in InstallRoot:
wget ... etinst.iso
qemu-system-x86_64 -enable-kvm -smp 6 -display gtk -m 4G -hda system.img -hdb home.img -cdrom debian-11.7.0-amd64-netinst.iso -device VGA,vgamem_mb=64 -device virtio-net,netdev=vmnic -netdev user,id=vmnic,hostfwd=tcp::8888-:22 -boot order=d

Give hostname: i2pqemu
new user: i2p and password i2p
encrypted partitions password: i2p (choose whatever)

Create the above partitions
Enable Openssh
[Video: Create.Env.StartSystemInstall.h264.mp4]
Shutdown system after install

### Start the System

# Script in InstallRoot:
qemu-system-x86_64 -enable-kvm -smp 6 -display gtk -m 4G -hda system.img -hdb home.img -device VGA,vgamem_mb=64 -device virtio-net,netdev=vmnic -netdev user,id=vmnic,hostfwd=tcp::8888-:22 -boot order=c

Now you can log in or use the port forwarding of qemu to access the system by:
ssh i2p@ -p 8888 from your host.

You can also mount the guest system in your host system by:
# Script in InstallRoot:
sshfs -p 8888 i2p@ ./sshfsMount/

Install Apps:
# Script in /Desktop/InstallApps/

sudo apt-get install tigervnc-standalone-server zram-tools nmap iotop lsof zulucrypt-gui zulucrypt-cli zulumount-gui zulumount-cli caja caja-open-terminal pcmanfm mate-terminal firefox-esr geeqie dillo netsurf-gtk bleachbit openjdk-17-jre openjdk-17-jre-headless mc htop fluxbox byobu nmon pluma gnome-system-monitor smplayer mpv lightdm lxde engrampa

Optional: Some minor System configs:

zram: Change the file in /etc/default/zramswap with
Script in Desktop/
sudo mcedit /etc/default/zramswap
sudo pluma /etc/default/zramswap
set: percent=95 and priority=100

tmpfs for live user: Change the file in /etc/fstab with
Script in Desktop/
sudo mcedit /etc/fstab
sudo pluma /etc/fstab
add: sudo mount -t tmpfs -o size=95% none /home/live
tmpfs /home/live tmpfs defaults,size=95% 0 0

btrfs compression for the filesystem: Change the file in /etc/fstab with
Script in Desktop/
sudo mcedit /etc/fstab
sudo pluma /etc/fstab
paste: ,compress=zstd
after defaults,
Show users in lightdm: Change the file in /etc/fstab with
Script in Desktop/
sudo mcedit /etc/lightdm/lightdm.conf
sudo pluma /etc/lightdm/lightdm.conf
find/set to: greeter-hide-users=false

For sudo to work with gui apps: ... t-as-root/
added the line Defaults env_keep+="DISPLAY" to the end of the visudo file at /etc/sudoers
sudo mcedit /etc/sudoers

Shutdown system after or sudo reboot
Last edited by robabok978 on 30 Jun 2023 23:05, edited 2 times in total.
Posts: 36
Joined: 12 Feb 2022 02:58

Re: Building a minimal debian for i2p use in qemu vm.WIP

Post by robabok978 »

## Fluxbox Configuration

menu in .fluxbox folder:

[begin] (fluxbox)
[include] (/etc/X11/fluxbox/fluxbox-menu)
[submenu] (-I2P-)
[submenu] (I2P-Router)
[exec] (I2Pplus.Router.START) {~/Desktop/First.Install/I2P.Router/I2Pplus/}
[exec] (I2Pplus.Router.STOP) {~/Desktop/First.Install/I2P.Router/I2Pplus/}
[exec] (I2P.Router.START) {~/Desktop/First.Install/I2P.Router/I2P/}
[exec] (I2P.Router.STOP) {~/Desktop/First.Install/I2P.Router/I2P/}
[submenu] (Terminal)
[exec] (lxterminal) {lxterminal}
[exec] (mate-terminal) {mate-terminal}
[submenu] (Screensize)
[exec] (Screenresize_1920x1080) {xrandr -s 1920x1080}
[exec] (Screenresize_1280x960) {xrandr -s 1280x960}
[exec] (Screenresize_1200x720) {xrandr -s 1280x720}
[exec] (Screenresize_800x600) {xrandr -s 800x600}
[submenu] (Browser)
[exec] (I2P.Firefox-esr) {firefox-esr}
[exec] (LibreWolf.AppImage) {~/Desktop/AppImages/LibreWolf.x86_64.AppImage}
[exec] (falkon) {falkon}
[exec] (netsurf) {netsurf-gtk}
[exec] (surf) {surf}
[exec] (midori) {midori}
[exec] (dillo) {dillo}
[submenu] (Filebrowser)
[exec] (Caja) {caja}
[exec] (pcmanfm-qt) {pcmanfm-qt}
[exec] (pcmanfm) {pcmanfm}
[exec] (xfe) {xfe}
[submenu] (Media)
[exec] (smplayer) {smplayer}
[exec] (vlc) {vlc}
[exec] (geeqie) {geeqie}
[submenu] (Com)
[exec] (hexchat_I2P) {hexchat}
[exec] (MuWire-0.8.13) {~/Desktop/Install.otherApps/MuWire/MuWire-0.8.13/MuWire-0.8.13/bin/MuWire}
[exec] (MuWire-0.8.13-beta5) {~/Desktop/Install.otherApps/MuWire//MuWire-0.8.13-beta5/MuWire-0.8.12/bin/MuWire}
[submenu] (Tools)
[exec] (Peazip) {bleachbit}
[exec] (Bleachbit) {bleachbit}
[exec] (Bleachbit as Root) {sudo bleachbit}
[exec] (xarchiver) {xarchiver}
[exec] (zuluCrypt-gui) {zuluCrypt-gui}
[exec] (zuluMount-gui) {zuluMount-gui}
[exec] (gkrellm -w) {gkrellm -w}
[exec] (flameshot) {flameshot}
[exec] (gnome-system-monitor) {gnome-system-monitor -s}
[exec] (conky) {conky}

### Main scripts

## I2P as I2PRouter
[video: FirstTime.I2P.Install.h264.mp4]
Script in Desktop/First.Install/I2P.Router/I2P:
mkdir ~/i2p
cd ~/i2p
wget ... _2.2.1.jar
java -jar ./i2pinstall_*.jar

ln ~/Desktop/First.Install/I2P.Router/I2P/ ~/Desktop/
ln ~/Desktop/First.Install/I2P.Router/I2P/ ~/Desktop/

## I2P+ as I2PRouter
[video: FirstTime.I2Pplus.Install.h264.mp4]
Script in Desktop/First.Install/I2P.Router/I2Pplus:
mkdir ~/i2pplus
cd ~/i2pplus
wget ... 2.2.0+.exe
java -jar ./i2pinstall_*.exe

ln ~/Desktop/First.Install/I2P.Router/I2Pplus/ ~/Desktop/
ln ~/Desktop/First.Install/I2P.Router/I2Pplus/ ~/Desktop/

## Browser Extensions ~/Desktop/Install.otherApps/

# ... de-Firefox
wget ... 1.4.22.xpi -P ~/Desktop/Install.otherApps/BrowserAddons/

# ... x/releases
wget ... -P ~/Desktop/Install.otherApps/BrowserAddons/

wget ... irefox.xpi -P ~/Desktop/Install.otherApps/BrowserAddons/

## PeaZip for archives ~/Desktop/Install.otherApps/
mkdir ~/Desktop/Install.otherApps/Peazip/
cd ~/Desktop/Install.otherApps/Peazip
wget ... _amd64.deb
sudo apt install ~/Desktop/Install.otherApps/Peazip/peazip_9.2.0.LINUX.GTK2-1_amd64.deb
Posts: 36
Joined: 12 Feb 2022 02:58

Re: Building a minimal debian for i2p use in qemu vm.WIP

Post by robabok978 »

## Hexchat Install + opens the i2pirc tutorial
Script in /Desktop/Install.otherApps:
sudo apt install hexchat

## Stegano Apps ~/Desktop/Install.otherApps/
mkdir ~/Desktop/Install.otherApps/openstego/
cd ~/Desktop/Install.otherApps/openstego/
wget ...
unzip *.zip

# deb way:
wget ... -1_all.deb
sudo apt install openstego_0.8.6-1_all.deb

## LibreWolf

# Appimages way:
wget -O ./Desktop/AppImages/ ... 4.AppImage
chmod +x ./Desktop/AppImages/*.AppImage

# More comfort Apps Environments

### Apps choice reasons besides 'i use them, that's why'

zram general useful, needed for low ram systems
mc file commander/editor for terminal
plume comfort, nice
pcmanfm small, nice, like caja
caja more nice, extensions, features, look, bookmarks, open in terminal...
netsurf-gtk small, maybe for permanent i2pconsole otherwise not so usable
gnome-system-monitor overview, look, comfort
peazip nice, features
xnview nice, features, exif remove, post useful
smplayer, mpv small, fast
mate-terminal features, better ones?
lxde that would only be 150mb more, for more comfortable desktop. But main would be fluxbox
xrandr for setting the screen size
libreWolf alternative for i2p browsing
engrampa alternative for compress/decompress
Posts: 36
Joined: 12 Feb 2022 02:58

Re: Building a minimal debian for i2p use in qemu vm.WIP + usblivebuild

Post by robabok978 »

### Make a usb live system of your running system

## Linux Live Kit

# Install the Linux Live Kit
[video: LinuxLiveKit.Install.h264.mp4]
Script in /Desktop/Install.otherApps:
sudo apt install firmware-linux-nonfree firmware-iwlwifi firmware-realtek i965-va-driver vainfo libvdpau-va-gl1 i965-va-driver vdpauinfo mesa-vdpau-drivers mesa-va-drivers
sudo apt install squashfs-tools genisoimage zip
sudo mkdir /a
cd /a
sudo wget ... .10.tar.gz
sudo tar -xvpf v2.10.tar.gz

# Prepare the Linux Live Kit
[video: LinuxLiveKit.Prepare.h264.mp4]
Script in /Desktop/Install.otherApps:
# set to /boot/vmlinuz-yourkernelversion
sudo mcedit /a/linux-live-2.10/config
# livekitlib, search for zram, adjust zram size
sudo mcedit /a/linux-live-2.10/livekitlib

# Build the Linux Live Kit usb zip file
[video: LinuxLiveKit.BuildUsbZip.h264.mp4]
Script in /Desktop/Install.otherApps:
sudo /a/linux-live-2.10/
sudo /tmp/
sudo chmod a+rwx /tmp/

# Script in InstallRoot:
from host:
scp -P 8888 i2p@localhost:/tmp/ ./
Post Reply