todo make theseediso cloud init stuff happen inside the vm storage directory so that multiple poeple can use it ast the same time on the same system vm compute create name1 -os fedora -vcpu 1 -ram 1 -disk 10 -s.pool storage1 -add-disk 200 storage2 -add-network nw3 # default fedora 4,4,20 # fedora not available. available os: listed down # storage not available. please create it # nw3 not available. create y/n? vm network create 192.168.100.1 /32 vm network create (auto) vm storage create /dev/ vm storage create /dir/ vm/ ./vm.sh # Single entry point. one vm at a time(except for compute delete-all) .config/ # all config files init/ # run this everytime. try to think of a way to set a flag that says this device has been initialised install_packages.sh make_rootkey.sh # in /root/k/k1. can also add keys in here /var/lib/libvirt/images/.image_store/ # stores the images /var/lib/libvirt/images/.temp/ # for user-data, meta-data, and seed.iso(has ud and md inside) need to delete after initialising a new vm image/ # vm cloud init templates to make user-data, meta-data, and seed.iso fedora.sh # images in /var/lib/libvirt/images/.image_store/ and in images/.temp opensuse.sh debian.sh freebsd.sh list-all-images.sh compute/ create.sh # default vcpu ram disk storage pool network # allow specification of storage pool and network. # auto list all available images, storage pools, networks. on no argument. just call stroage/network list.sh delete.sh and all associated virtual machines and block devices on all storage device start.sh before starting the vm, make sure the cloud init seed.iso is not attached anymore. shutdown.sh list.sh # list by (sorted by) network group, ip address, then cpu ram disk, total disk(incl all attachedvols), name network/ attach.sh # one click, so if vm is running, ask fro permission to shutdown. or if can, live attach list.sh detach.sh create.sh # allow specifying the ip address range. auto make uuid delete.sh disk/ attach.sh detach.sh create.sh list all available storage hardware devices on no argument. just call list.sh make directory linking from /var/lib/libvirt/images/${VM_NAME}-vm-disks/ to the actual storage device delete.sh delete all blocks. all the linking if can. may not be able to link like that idk. list all mounts and delete the originla and the links list.sh #list storage pools and include --all to view all blocks and their sizes device/ usb/ attach.sh detach.sh view.sh # usbs of all the vms # No arguments shows available options ./vm compute create Available networks: prod-net 192.168.1.0/24 dev-net 192.168.2.0/24 test-net 192.168.3.0/24 Available storage pools: prod-store 2TB free dev-store 500GB free backup 1TB free Available images: fedora40(41) Usage: ./vm compute create --vcpu 4 --ram 8 --disk 40 --storage-pool prod-store --network prod-net # Then use directly ./vm compute create myvm fedora40 prod-net prod-store os for debian12, sudo dnf install libguestfs libguestfs-tools libvirt virt-install virt-manager guestfs-tools sudo virt-customize -a /var/lib/libvirt/images/.image_store/debian12.qcow2 --root-password password:yourpassword sudo apt update && sudo apt install -y ssh cloud-init console works but no ssh, and the generic cloud ssh fails after editing the password(not sure if this is the reason) try to find out how to execute commands in sudo virsh console t1 in a bash script not sure if cloud init can work after this but currently only fedra works fully, debian can work and login after editing the root password freebsd have not tried editing root password, boots on generic cloud image, no login yet ubuntu no boot no login yet. others ssh public ssh port like online vps this forwards 2222 on the host to port 22 # 1. First, check your VM's IP address (from inside the VM) ip addr show # 2. Set up port forwarding in libvirt virsh net-list # List networks virsh net-edit default # Edit default network config # Add this inside the section: tcp # Replace x with your VM's last octet # 3. Restart the network virsh net-destroy default virsh net-start default # 4. Configure firewall on Fedora host sudo firewall-cmd --add-port=2222/tcp --permanent sudo firewall-cmd --reload seed.iso move seed.iso to images/vmname/seed.iso allows concurrent usage of vm.sh as there will be no conflicts