User Tools

Site Tools


tech:linux:ubuntu:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tech:linux:ubuntu:start [2022/03/04 14:26]
rk4n3 Updated KVM/qemu example script
tech:linux:ubuntu:start [2023/04/21 10:11] (current)
rk4n3
Line 26: Line 26:
     * For wifi: wpasupplicant     * For wifi: wpasupplicant
     * For audio: jack2 pulseaudio pulseaudio-module-jack qjackctl     * For audio: jack2 pulseaudio pulseaudio-module-jack qjackctl
-    * For X: xorg xinit xauth x11-xserver-utils xterm notion fvwm stalonetray+    * For X: xorg xinit xauth x11-xserver-utils xterm notion fvwm stalonetray ​xscreensaver xscreensaver-gl-extra xscreensaver-data-extra
     * tigervnc-viewer     * tigervnc-viewer
-  * Networking ​''/​etc/​cloud/​cloud.cfg.d/​50-curtin-networking.cfg''​ & ''/​etc/​netplan/​50-cloud-init.yaml'':​ \\ //(Note: ''​wifis''​ section optional)//<​code yaml>​network:​+  * Networking ''/​etc/​netplan/​whateveryourfilenameis.yaml'':​ \\ //(Note: ''​wifis''​ section optional)//<​code yaml>​network:​
   version: 2   version: 2
   renderer: networkd   renderer: networkd
Line 50: Line 50:
 ===== Virtualization Server ===== ===== Virtualization Server =====
 ==== Bridged Networking ==== ==== Bridged Networking ====
-  * In ''/​etc/​cloud/cloud.cfg.d/50-curtin-networking.cfg'' ​''/​etc/​netplan/​50-cloud-init.yaml'':<​code yaml> ​ bridges:+  * Packages: ''​bridge-utils''​ 
 +  * Populate ​''/​etc/​sysctl.d/20-bridge.conf''​ with:<​code>​net.bridge.bridge-nf-call-ip6tables=0 
 +  net.bridge.bridge-nf-call-iptables=0 
 +  net.bridge.bridge-nf-call-arptables=0</​code>​ 
 +  * Populate ''/​etc/​udev/​rules.d/99-bridge.rules'' ​with:<​code>​ACTION=="​add",​SUBSYSTEM=="​module",​KERNEL=="​br_netfilter",​RUN+="/​sbin/​sysctl -p /​etc/​sysctl.d/​20-bridge.conf"</​code>​ 
 +  * In ''/​etc/​netplan/​whateveryourfilenameis.yaml'':<​code yaml>network: 
 +  version: 2 
 +  renderer: networkd 
 +  ethernets:​ 
 +    enp4s0: 
 +      dhcp4: false 
 +      dhcp6: false 
 +  ​bridges:​
     br0:     br0:
-      macaddress: DE:​AD:​BE:​EF:​00:16 +      macaddress: DE:​AD:​BE:​EF:​10:01 
-      interfaces: [enp24s0]+      interfaces: [enp4s0]
       dhcp4: true       dhcp4: true
       parameters:       parameters:
Line 122: Line 134:
         * Create filesystem directly on the physical device         * Create filesystem directly on the physical device
         * Add entry to ''/​etc/​fstab''​ to mount the filesystem at desired location         * Add entry to ''/​etc/​fstab''​ to mount the filesystem at desired location
-  * Sample VM start-up script: ​<code bash> +  * Sample VM start-up script: ​[[:tech:virt:start|startvm]]
-#​!/​bin/​bash +
-VMN=yourvmname +
-VNC="​12"​ +
-MAC0="​DE:AD:BE:EF:​00:​12"​ +
- +
-VMH=/​var/​lib/​kvm +
-CPUT=EPYC +
-CPUS=4 +
-VMM=8G +
-VGA="​-vga virtio -display gtk" +
-# Headless ... +
-#​VGA="​-vnc localhost:​${VNC} -daemonize"​ +
- +
-VGN="​yourvgname"​ +
-SIM= +
-HD0= +
-HD1= +
-HD2= +
-NIC0= +
-NIC1= +
-TPM= +
-SND= +
- +
-# Boot device - d=cdrom, c=disk +
-BOOT="​-boot c" +
- +
-function initTPM { +
- TPD=$(ps -ef grep swtpm | grep -v grep) +
- if [ "​${TPM}"​ != ""​ -a "​${TPD}"​ == "" ​]; then +
- swtpm socket -d --tpmstate dir=/​var/​lib/​kvm/​${VMN}/​tpm --ctrl type=unixio,​path=/​var/​lib/​kvm/​${VMN}/​tpm/​sock --log file=tpm.log,​level=20 --tpm2 +
- else echo "​NFO=>>>​ software TPM daemon detected, skipping its startup"​ ; fi +
-+
- +
-function vmOptionsWin11 { +
- CPUT=EPYC,​kvm_pv_eoi=on +
-#​ SIM="​-cdrom ${VMH}/​iso/​Win11_English_x64v1.iso"​ +
-#​ SIM="​-cdrom ${VMH}/​iso/​virtio-win-0.1.208.iso"​ +
- HD0="​-hda vda" +
- HD1="​-drive file=/​dev/​${VGN}/​dwin,​index=1,​media=disk,​format=raw"​ +
-#​ NIC0="​-netdev bridge,​id=${VMN}eth0,​br=br0 -device e1000,​netdev=${VMN}eth0,​mac=${MAC0}"​ +
- NIC0="​-netdev bridge,​id=${VMN}eth0,​br=br0 -device virtio-net-pci,​netdev=${VMN}eth0,​mac=${MAC0}"​ +
- TPM="​-bios /​usr/​share/​ovmf/​OVMF.fd -chardev socket,​id=chrtpm,​path=/​var/​lib/​kvm/​${VMN}/​tpm/​sock -tpmdev emulator,​id=tpm0,​chardev=chrtpm -device tpm-tis,​tpmdev=tpm0"​ +
- initTPM +
-+
- +
-function vmOptionsLinux { +
-#​ SIM="​-cdrom ${VMH}/​iso/​ubuntu-20.04.3-live-server-amd64.iso"​ +
- HD0="​-drive file=vda,​if=virtio"​ +
- HD1="​-drive file=vdb,​if=virtio"​ +
- HD2="​-drive file=/​dev/​${VGN}/​${VMN}home,​if=virtio,​index=2,​media=disk,​format=raw"​ +
- NIC0="​-netdev bridge,​id=${VMN}eth0,​br=br0 -device virtio-net-pci,​netdev=${VMN}eth0,​mac=${MAC0}"​ +
-+
- +
-function vmOptions { +
- vmOptionsLinux +
-#​ vmOptionsWin11 +
-+
- +
-cd ${VMH}/​${VMN} +
-vmOptions +
-qemu-system-x86_64 -machine pc,​accel=kvm -name "​${VMN}"​ -cpu ${CPUT} -smp ${CPUS} -m ${VMM} ${BOOT} ${VGA} ${NIC0} ${NIC1} ${HD0} ${HD1} ${HD2} ${SIM} ${TPM} ${SND} +
-</​code>​+
  
 ==== Advanced/​Other Virtualization ==== ==== Advanced/​Other Virtualization ====
Line 223: Line 173:
   * vim-gtk   * vim-gtk
   * openssh-server   * openssh-server
-  * ksh 
   * htop   * htop
   * git   * git
Line 248: Line 197:
  
 ==== Disable PulseAudio auto-spawn ==== ==== Disable PulseAudio auto-spawn ====
-If you want to run Jack for low-latency high-performance audio, you'll need to make sure that Jack can grab your audio interface directly, which means you won't want PulseAudio to grab it on startup. ​ Disabling PulseAudio auto-spawn is most likely necessary, so you can start it manually after Jack is running:+If you want to run Jack for low-latency high-performance audio, you'll need to make sure that Jack can 
 +grab your audio interface directly, which means you won't want PulseAudio to grab it on startup. 
 +Disabling PulseAudio auto-spawn is most likely necessary, so you can start it manually after Jack is running: 
 +  * Stop already-running (auto-spawned) instance(s):<​code>​systemctl --user stop pulseaudio.socket 
 +systemctl --user stop pulseaudio.service 
 +sudo systemctl stop pulseaudio 
 +sudo systemctl disable ​ pulseaudio</​code>​
   * Change in ''/​etc/​pulse/​client.conf'':​ <​code>​autospawn = no   * Change in ''/​etc/​pulse/​client.conf'':​ <​code>​autospawn = no
 daemon-binary = /​bin/​true ​ daemon-binary = /​bin/​true ​
 </​code>​ </​code>​
 +  * Change in ''/​etc/​pulse/​daemon.conf'':​ <​code>​daemonize = no</​code>​
   * Rename startup file: <code bash>mv /​etc/​rc2.d/​S50pulseaudio /​etc/​rc2.d/​K50pulseaudio</​code>​   * Rename startup file: <code bash>mv /​etc/​rc2.d/​S50pulseaudio /​etc/​rc2.d/​K50pulseaudio</​code>​
 +  * Completely disable any depedency service spawning: <​code>​sudo systemctl mask pulseaudio</​code>​
  
 ==== Route PulseAudio through Jack ==== ==== Route PulseAudio through Jack ====
Line 445: Line 402:
  
 ====== Some Hardware Trivia ====== ====== Some Hardware Trivia ======
 +
 +==== Mouse lag on Raspberry Pi 4b ====
 +In ''/​boot/​firmware/​cmdline.txt'',​ add to end of line:
 +<​code>​usbhid.mousepoll=8</​code>​
  
 ==== ACEPC W5 Pro: wifi ==== ==== ACEPC W5 Pro: wifi ====
tech/linux/ubuntu/start.1646425619.txt.gz · Last modified: 2022/03/04 14:26 by rk4n3