summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xothers/vm3/.config/cloud-init-generator/fedora40.sh4
-rw-r--r--others/vm3/.docs.swpbin16384 -> 16384 bytes
-rw-r--r--others/vm3/docs62
3 files changed, 47 insertions, 19 deletions
diff --git a/others/vm3/.config/cloud-init-generator/fedora40.sh b/others/vm3/.config/cloud-init-generator/fedora40.sh
index f32327d..fd2f0a0 100755
--- a/others/vm3/.config/cloud-init-generator/fedora40.sh
+++ b/others/vm3/.config/cloud-init-generator/fedora40.sh
@@ -49,8 +49,8 @@ runcmd:
- sudo xfs_growfs /
- sudo dnf install -y vim git
- cd /home/user
- - #git clone https://git.0nom.ch/setup
- - #sudo ./setup/setup.sh
+ - git clone https://git.0nom.ch/setup
+ - sudo ./setup/setup.sh
- touch /home/user/runcmd_done
EOF
diff --git a/others/vm3/.docs.swp b/others/vm3/.docs.swp
index 304e100..3eb0602 100644
--- a/others/vm3/.docs.swp
+++ b/others/vm3/.docs.swp
Binary files differ
diff --git a/others/vm3/docs b/others/vm3/docs
index dc5a3e6..e350e4e 100644
--- a/others/vm3/docs
+++ b/others/vm3/docs
@@ -77,20 +77,48 @@ Available images:
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 fedora 2 4 20 prod-net prod-store
-
-
-
-
-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.
+./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 <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