diff options
| author | root <root@sg1.noml.ch> | 2025-05-22 18:36:01 +0800 |
|---|---|---|
| committer | root <root@sg1.noml.ch> | 2025-05-22 18:36:01 +0800 |
| commit | 3a52e92fbbbab4df949740f89a389d68281a9428 (patch) | |
| tree | 5cb3b864eb0e3f3b90a1efd9cbdee1fb9f158f4a /others/vm3/docs | |
| parent | 8cb260002db7c46ea5fe2c3f589b485e5f5d970d (diff) | |
Diffstat (limited to 'others/vm3/docs')
| -rw-r--r-- | others/vm3/docs | 121 |
1 files changed, 0 insertions, 121 deletions
diff --git a/others/vm3/docs b/others/vm3/docs deleted file mode 100644 index eea91d1..0000000 --- a/others/vm3/docs +++ /dev/null @@ -1,121 +0,0 @@ - -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 - fedora debian freebsd opensuse - change deployment for non-fedora to manually make a base image and copy ssh stuff over, then duplicate it however you want - - - -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 <name> 192.168.100.1 /32 -vm network create <name> (auto) -vm storage create <name> /dev/ -vm storage create <name2> /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 <vm name> # 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 <name> <os> --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 - debian functionally works, and issues are primarily quality of life issues - Debian primarily uses /etc/bash.bashrc, move the colour to this instead of etc bashrc on fedora - change the localhost to name of the vm in the config app - - - 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 <network> section: - <forward mode='nat'> - <nat> - <port start='2222' end='2222'> - <protocol>tcp</protocol> - <forward address='192.168.122.x' port='22'/> # Replace x with your VM's last octet - </port> - </nat> - </forward> - # 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 |
