base-image-build/.devcontainer/useful-but-not-needed/Useful.md
2024-08-22 20:30:01 +01:00

64 lines
1.9 KiB
Markdown

# Can be used within the VS Code dev container to debug
### Create PXE network
```
virsh net-define ipxeboot.xml
virsh net-start ipxeboot
virsh net-autostart ipxeboot
```
### Start PXE machine
```
virt-install -n rocky --memory 4096 --vcpus 8 \
--pxe --disk size=25,bus=virtio --network network=ipxeboot,model=virtio \
--input tablet --os-variant rhel9.0 \
--noautoconsole
```
```
virt-install -n rocky --memory 512 --vcpus 1 \
--pxe --disk size=5,bus=virtio --network network=alpineipxeboot,model=virtio \
--input tablet --os-variant id=http://alpinelinux.org/alpinelinux/3.19 \
--noautoconsole
```
### Inside a virt-install VM
```
[rocky@localhost ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 4.0M 0 4.0M 0% /dev
tmpfs 2.0G 0 2.0G 0% /dev/shm
tmpfs 783M 8.7M 775M 2% /run
/dev/vda4 9.4G 1.4G 8.1G 15% /
/dev/vda3 936M 220M 717M 24% /boot
/dev/vda2 100M 11M 90M 11% /efi
tmpfs 392M 0 392M 0% /run/user/1000
```
### Inside a virt-customize flow:
```
virt-df -h -a Rocky-9-GenericCloud-Base.latest.x86_64.qcow2
Filesystem Size Used Available Use%
Rocky-9-GenericCloud-Base.latest.x86_64.qcow2:/dev/sda2
100M 7.0M 93M 8%
Rocky-9-GenericCloud-Base.latest.x86_64.qcow2:/dev/sda3
936M 180M 756M 20%
Rocky-9-GenericCloud-Base.latest.x86_64.qcow2:/dev/sda4
9.3G 1.4G 7.9G 16%
```
### Currently not needed, but if need in the future - systemctl/docker during build:
```
docker buildx create --use --name insecure-builder --buildkitd-flags '--allow-insecure-entitlement security.insecure'
docker buildx use insecure-builder
docker buildx build -t monolithify/dev --load --allow security.insecure .
docker buildx use default
```