Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmz1 authored Apr 2, 2023
0 parents commit fb96a07
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 0 deletions.
36 changes: 36 additions & 0 deletions qemu comando
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
cria um hd de 30gb

./QEMU-x86_64.AppImage qemu-img create -f qcow2 windows10.qcow2 30G

boota uma iso no hd

./QEMU-x86_64.AppImage qemu-system-x86_64 -hda ~/Downloads/fedora.qcow2 -m 4096m -cdrom ~/Downloads/Fedora-Xfce-Live-x86_64-37-1.7.iso -boot c -machine ubuntu,accel=kvm


boota o sistema instalado no hd

./QEMU-x86_64.AppImage qemu-system-x86_64 -enable-kvm -m 4096m -name 'fedora' -boot d -hda fedora.qcow2

./QEMU-x86_64.AppImage qemu-system-x86_64 -enable-kvm -cpu host -smp cores=2 -m 4096m -name 'Android' -boot d -hda ~/Documentos/Ghostbsd.qcow2

sudo QEMU-x86_64.AppImage qemu-system-x86_64 -enable-kvm -cpu host -smp cores=2 -m 4096m -name 'Manjaro' -boot d -hda ~/Documentos/Manjaro.qcow2 -cdrom ~/Documentos/manjaro-gnome-21.3.7-220816-linux515.iso


sudo QEMU-x86_64.AppImage qemu-system-x86_64 -enable-kvm -cpu host -smp cores=2 -m 4096m -soundhw hda -name 'Manjaro' -boot d -hda ~/Documentos/Manjaro.qcow2


Este comando compartilha uma pasta no qemu comando para ser rodado no host

QEMU-x86_64.AppImage qemu-system-x86_64 -M q35 -vga virtio -enable-kvm -cpu host -smp cores=2 -m 4G -name 'Xubuntu' -boot c -hda ~/Downloads/Xubuntu.qcow2 -virtfs local,path=/home/lucas/Modelos/,mount_tag=host0,security_model=mapped,id=host0

comando para ser rodado no guest = máquina virtual

mount -t 9p -o trans=virtio,version=9p2000.L host0 /home/lucas/Modelos/


Fonte:
https://askubuntu.com/questions/290668/how-to-share-a-folder-between-kvm-host-and-guest-using-virt-manager

https://askubuntu.com/questions/884534/how-to-run-ubuntu-desktop-on-qemu/1046792#1046792

se adicionar qemu -vga std ou -vga virtio no inicio da linha isso habilta altas resoluções.
13 changes: 13 additions & 0 deletions qemu comdo de montagem de pasta compartilhada
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Este comando compartilha uma pasta no qemu comando para ser rodado no host

QEMU-x86_64.AppImage qemu-system-x86_64 -M q35 -enable-kvm -cpu host -smp cores=2 -m 4G -name 'Xubuntu' -boot c -hda ~/Downloads/Xubuntu.qcow2 -virtfs local,path=/home/lucas/Modelos/,mount_tag=host0,security_model=mapped,id=host0

comando para ser rodado no guest

mount -t 9p -o trans=virtio,version=9p2000.L host0 /home/lucas/Modelos/


Fonte:
https://askubuntu.com/questions/290668/how-to-share-a-folder-between-kvm-host-and-guest-using-virt-manager

https://askubuntu.com/questions/884534/how-to-run-ubuntu-desktop-on-qemu/1046792#1046792
25 changes: 25 additions & 0 deletions qemu montagem de imagem qcow2
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Step 1 - Enable NBD on the host

modprobe nbd max_part=8

Step 2 - Connect the QCOW2 as a network block device

qemu-nbd --connect=/dev/nbd0 /var/lib/vz/images/100/vm-100-disk-1.qcow2

Step 3 - List partitions inside the QCOW2

fdisk /dev/nbd0 -l

Step 4 - Mount the partition from the VM

mount /dev/nbd0p1 /mnt/somepoint/

You can also mount the filesystem with normal user permissions, ie. non-root:

mount /dev/nbd0p1 /mnt/somepoint -o uid=$UID,gid=$(id -g)

Step 5 - After you're done, unmount and disconnect

umount /mnt/somepoint/
qemu-nbd --disconnect /dev/nbd0
rmmod nbd

0 comments on commit fb96a07

Please sign in to comment.