Duongkum999 commited on
Commit
75242bf
·
verified ·
1 Parent(s): 67be76b

Update on_startup.sh

Browse files
Files changed (1) hide show
  1. on_startup.sh +22 -4
on_startup.sh CHANGED
@@ -1,5 +1,23 @@
1
  #!/bin/bash
2
- # Write some commands here that will run on root user before startup.
3
- # For example, to clone transformers and install it in dev mode:
4
- # git clone https://github.com/huggingface/transformers.git
5
- # cd transformers && pip install -e ".[dev]"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  #!/bin/bash
2
+ # Cài đặt các phần mềm cần thiết cấu hình máy ảo
3
+ # dụ, tải về cấu hình một máy ảo Ubuntu
4
+ VM_NAME="ubuntu-vm"
5
+ VM_IMG="/var/lib/libvirt/images/$VM_NAME.img"
6
+
7
+ # Tạo một ổ đĩa ảo
8
+ qemu-img create -f qcow2 $VM_IMG 20G
9
+
10
+ # Cài đặt máy ảo
11
+ virt-install \
12
+ --name $VM_NAME \
13
+ --os-variant ubuntu20.04 \
14
+ --vcpu 2 \
15
+ --ram 2048 \
16
+ --disk path=$VM_IMG \
17
+ --import \
18
+ --graphics none \
19
+ --console pty,target_type=serial \
20
+ --network network=default
21
+
22
+ # Cấu hình để tự động khởi động máy ảo khi container khởi động
23
+ virsh autostart $VM_NAME