[personal profile] muwlgr
This note is a kind of improvement over its earlier version at muwlgr.dreamwidth.org/48219.html .
I created a Windows10 installation USB on a 64GB(57.7GiB) flash drive, where I still had >40GB of free space after copying lots of additional useful software and drivers there.
The USB contains EFI folder with all needed subfolders for UEFI/SecureBoot booting.
As well it has some boot code for BIOS/CSM systems not supporting UEFI.
I plug the USB drive into a running Debian 13 system, mount it as /media/someone/ESD-USB and cd into this folder in bash shell.
All the following operations are done within this folder
Note, with this setup, your linux folder is going to take at least 8 GB of storage space, most probably, closer to 9..10GB
Later update: I moved most scripts into my GitHub repository to avoid repelling the reader with vast code blankets.
So, what is left for you to do now, is :
( cd /tmp 
  wget https://raw.githubusercontent.com/muwlgr/scripts/refs/heads/main/debootstrap/populate.sh )
. /tmp/populate.sh
# wait some time for its completion
# this will bring you into the root of debootstrapped system
# paste the following command separately :

. root/complete-stable.sh

After the above steps, you should have a well configured Debian system, taking up to 600MB or 15..16% of 4GB root filesystem space and needing only to add a first user with sudo rights, in Ubuntu style, that is, without root password :
u=user # choose your preferred name
adduser $u # set your password and other details
adduser $u sudo # give this user sudo permissions

Now type
exit # wait for umounts ; paste the following commands separately

sudo umount -v $target
cd
umount -v $base
and try booting this newly-created system on a real or virtual hardware.
If your UEFI BIOS does not recognize Debian boot loader and only boots Windows instead, plug your USB back into the original host system, mount it, cd into its root folder in bash shell and do this:
[ -d efi ] && { cd efi
 [ -d boot ] && mv boot ms-boot
 cp -av debian boot
 cd boot
 cp -av shimx64.efi bootx64.efi
}
Umount and remove the USB media, plug it into the desired system and try booting again.
If you want to restore Windows bootability, rename boot into deb-boot , and ms-boot back into boot .
Or you might meet a sane BIOS capable of recognizing multiple boot loaders in one UEFI ESP
See wiki.debian.org/UEFI and search for bootx64 in this page to learn more about this unpleasant topic.
Below some useful next steps are described :
Suppose you have been able to log in as the user you have added before.
Suppose you can run sudo id , enter your password and see uid and gid equal to 0, which means that sudo gives you root access.
If you have booted on some new/unknown hardware, take a moment to review the printout of sudo dmesg | grep -i firm to see whether any drivers were unable to find their firmware files.
If you see messages about missing firmware files, find them using packages.debian.org and install needed package using apt install
Run date , and you should see weekday and month names printed in in your native non-Latin letters.
If the font is wrong, run unset LANG to switch back to C or en_US locale,
then run sudo dpkg-reconfigure console-setup to try different codepage and font.

You may also want to install some useful packages to bring more familiar experience to yourself
(add sudo and eatmydata before apt install as needed - useful if your USB flash drive is slow on writes) :

bash-completion to improve Tab completion in bash command line;
command-not-found to automate searching for not yet installed packages;
man-db to read invaluable documentation within your running system;
openssh-server to access your system remotely;
rsync to optimally copy local and remote files over the network (works over ssh);
nmap and tcpdump to scan and diagnose your network, to discover its resources;
icewm xdm xorg xterm to get basic GUI environment in which you may run other GUI software
x11vnc to provide remote access to your locally-running GUI session
And/or xvfb to run GUI applications in headless mode (works over ssh port forwarding)
Or maybe xpra.org to get more advanced access to persistent headless GUI applications (also works over ssh)
pciutils usbutils lshw smartmontools to discover, enumerate and learn more about the available hardware and its operation statistics
sysstat iotop to monitor storage i/o and its statistics, a useful addition to ps, top and vmstat from procps package
iw rfkill wireless-tools wireless-regdb wpasupplicant to take control over your WiFi adapter
hostapd instead of wpasupplicant to turn your computer into a WiFi access point and router (ensure it has more than 1 network interface)
dkms to build out-of-kernel modules for your VGA or WiFi hardware
module-assistant for even better automation of the preceding task
You may be walking around with your bootable USB drive, plugging it into various computers, booting, logging in and trying to access the Internet. Your systemd-networkd is configured for dynamic IP allocation for en* and wl* interfaces (see it by running grep . /etc/systemd/network/*.network ). For en* interfaces everything should work as expected, just run ip a to see your allocated address. For wl* interfaces you need additional configuration using wpa_supplicant. First, a script looking for wl* interfaces on your system and starting wpa_supplicant per-interface:
for ifn in $(iw dev | awk '$1=="Interface"{print $2}') 
do cf=/etc/wpa_supplicant/wpa_supplicant-$ifn.conf
   [ -s $cf ] || {
    ls -t /etc/wpa_supplicant/wpa_supplicant-*.conf | head -n1 | while read cf0
    do [ -s "$cf0" ] && cp -av $cf0 $cf
    done
    [ -s $cf ] || { umask 022 
     egrep -i '(update_config|ctrl_interface)=' /usr/share/doc/wpasupplicant/examples/wpa-roam.conf | sed 's/^#//' > $cf
    }
   }
   systemctl is-active wpa_supplicant && systemctl stop wpa_supplicant
   systemctl start wpa_supplicant@$ifn
done
get it from raw.githubusercontent.com/muwlgr/scripts/refs/heads/main/wpa/wpa-networkd.sh , run it as root

Next, a minimal bit of knowledge on how to use wpa_cli :

Run it as root : sudo wpa_cli , and you will enter its command line with > prompt
Run scan and after some pause scan_results to see discovered wireless networks
Run add_network and remember the number of a newly-created empty network (denote it as N)
Run set_network N ssid "WiFiNetName" and set_network N psk "WiFiNetPassword" to set some name and password known to you for this network
Run enable_network N to let wpa_supplicant connect to this network
Run list_networks to see if you are connected to any network (marked [CURRENT])
Run save_config to save your updated network list
Run exit or type Ctrl+D to exit wpa_cli and return back to your shell
Then run ip a to see what addresses your interface had received.

wpa_cli together with systemd-networkd allow you to use your wireless interfaces without heavyweight management tools such as NetworkManager


Profile

Volodymyr Mutel

January 2026

S M T W T F S
    123
45678910
11121314151617
18192021222324
2526272829 3031

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 10th, 2026 12:37 am
Powered by Dreamwidth Studios