Libvirt package?

Locked
Message
Author
grelos
Posts: 69
Joined: Wed Mar 28, 2018 3:12 pm

Libvirt package?

#1 Post by grelos »

Hello,

I would like to move from Virtualbox to KVM/QEMU, so I need to install libvirt package.
I cannot find it in either the Stable Repo or the Test Repo.

Should I install it with apt-get?
Thank you
MX-19 on Lenovo 520-15IKB

User avatar
fehlix
Developer
Posts: 10370
Joined: Wed Apr 11, 2018 5:09 pm

Re: Libvirt package?

#2 Post by fehlix »

grelos wrote: Tue Oct 02, 2018 2:57 am I would like to move from Virtualbox to KVM/QEMU, so I need to install libvirt package.
I cannot find it in either the Stable Repo or the Test Repo.
Just install like this:

Code: Select all

sudo apt-get  install qemu-kvm libvirt-clients libvirt-daemon-system
perhaps add this GUI:

Code: Select all

sudo apt-get  install virt-manager 
Here a little starter-script, I'm using for running MX17 Linux ISO's within KVM/QEmu,
just as a template ... which can be used to boot KVM/Qemu with
sata-emulated drives (/dev/sda1) and paravirtual disk drives (/dev/vda1)
including shared folder.

Code: Select all

#-----------------------------------------------
#!/bin/bash
# fehlix:  KVM/Qemu start
# with sata-emulated drives (/dev/sda1) and paravirtual disk drives
# including shared folder
# qemu-starter.sh
set -x

ISO=/ISO/MX-Linux/MX-17.1/September/MX-17.1_September_x64.iso
IMG=/QEMU/MX-17.1_September_x64.img
DIR=/QEMU/SharedFolder

NAME=$( basename $IMG .img )
# ------------------------------------
# mount shared folder in guest:
# mkdir /tmp/shared_folder 
# mount -t 9p -o trans=virtio,version=9p2000.L,posixacl,cache=mmap shared_folder /tmp/shared_folder 
# ------------------------------------

BOOT_ORDER="cd"  # boot from IMG
BOOT_ORDER="dc"  # boot from ISO

VIRT="if=virtio"    # boot with para-virtual  drives: /dev/vda
VIRT="media=disk"   # boot with sata-emulated drives: /dev/sda

qemu-system-x86_64 \
	-name ${NAME} \
	-cpu host \
	-enable-kvm \
	-m 4048 \
	-smp 4 \
	-rtc base=utc \
	-netdev user,id=vmnic \
	-device virtio-net,netdev=vmnic \
	-virtfs local,id=shared_folder_dev_0,path=${DIR},security_model=none,mount_tag=shared_folder \
	-drive file=$IMG,index=0,${VIRT} \
	-cdrom $ISO \
	-boot order=${BOOT_ORDER} 

exit
:puppy:
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB

grelos
Posts: 69
Joined: Wed Mar 28, 2018 3:12 pm

Re: Libvirt package?

#3 Post by grelos »

Thank you. I am going to try later.
Can you copy virtual disk drive the same way of Virtualbox?
MX-19 on Lenovo 520-15IKB

User avatar
fehlix
Developer
Posts: 10370
Joined: Wed Apr 11, 2018 5:09 pm

Re: Libvirt package?

#4 Post by fehlix »

grelos wrote: Tue Oct 02, 2018 9:17 am Thank you. I am going to try later.
Can you copy virtual disk drive the same way of Virtualbox?
Well, the IMG-drive is a file which you can copy.
I have adjusted the creation if not exist in this starter example.

Code: Select all

#-----------------------------------------------
#!/bin/bash
# fehlix:  KVM/Qemu start
# with sata-emulated drives (/dev/sda1) and paravirtual disk drives
# including shared folder
# qemu-starter.sh
set -x

ISO=/ISO/MX-Linux/MX-17.1/September/MX-17.1_September_x64.iso
IMG=/QEMU/MX-17.1_September_x64.img
DIR=/QEMU/SharedFolder

# create QEMU-IMG if not erxists
SIZ=32G
[ -f $IMG ] || qemu-img create -f qcow2 ${IMG} ${SIZ}

NAME=$( basename $IMG .img )
# ------------------------------------
# mount shared folder in guest:
# mkdir /tmp/shared_folder 
# mount -t 9p -o trans=virtio,version=9p2000.L,posixacl,cache=mmap shared_folder /tmp/shared_folder 
# ------------------------------------

BOOT_ORDER="cd"  # boot from IMG
BOOT_ORDER="dc"  # boot from ISO

VIRT="if=virtio"    # boot with para-virtual  drives: /dev/vda
VIRT="media=disk"   # boot with sata-emulated drives: /dev/sda

qemu-system-x86_64 \
	-name ${NAME} \
	-cpu host \
	-enable-kvm \
	-m 4048 \
	-smp 4 \
	-rtc base=utc \
	-netdev user,id=vmnic \
	-device virtio-net,netdev=vmnic \
	-virtfs local,id=shared_folder_dev_0,path=${DIR},security_model=none,mount_tag=shared_folder \
	-drive file=$IMG,index=0,${VIRT} \
	-cdrom $ISO \
	-boot order=${BOOT_ORDER} 
exit
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB

grelos
Posts: 69
Joined: Wed Mar 28, 2018 3:12 pm

Re: Libvirt package?

#5 Post by grelos »

I am already running into a bunch of problems, basically all due to using external HDDs either for storage and for the installation ISO. VMM claims that it cannot access them. Last problem is something about Virtual Manager default firewall.
Well, KVM is nice but now I have no time to fix this. I am sticking to Virtualbox then.
MX-19 on Lenovo 520-15IKB

bobbee
Posts: 115
Joined: Sun Apr 07, 2019 7:17 pm

Re: Libvirt package?

#6 Post by bobbee »

Thank you @fehlix, I was missing one or two of those dependencies.
The script is interesting too. I do mine from the gui, but might be handy sometime.
I install virt-manager with -y --install-suggests. That puts a bunch of stuff on. I also needed etables and dns-masq and I think some other stuff
As you have in your script, the mx linux install doesn't like the default virtual drive, had to change that, I also used sata.
It took a bit to install it on mint too when I had that on my machine before I switched to mx linux.

User avatar
Redd56
Posts: 1
Joined: Tue Apr 23, 2019 7:00 am

Re: Libvirt package?

#7 Post by Redd56 »

Im sittin on 19.2 and even with all this installed its still giving errors saying it wants libvirt
update: was able to find spicegtk in the package installer. all is well now jsut for other things

Locked

Return to “Package Requests/Status - MX 17/18”