LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-08-2023, 05:10 PM   #1
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,077

Rep: Reputation: Disabled
No internet in a Qemu VM


I have built and installed Qemu 7.2.1 in Slint64-15.0 based on Slackware64-15.0, using the SlackBuild from SBo without any modification or specific setting.

I can start a VM, but can't get a wired connection in it. This did not happen using Qemu 6.2., using the same script in both cases, example pasted below. I have tried using two VMs, in which I got a connection previously.

Code:
#!/bin/sh
qemu-system-x86_64 \
-cpu host \
-enable-kvm \
-boot menu=on \
-boot order=c \
-m 4G \
-device intel-hda \
-device hda-duplex \
-display gtk \
-vga std \
-drive if=pflash,format=raw,readonly=on,file=/data/qemu/firmware/OVMF_CODE.fd \
-drive if=pflash,format=raw,file=/data/qemu/firmware/OVMF_VARS.fd \
-fsdev local,id=vmdata,path=/data/,security_model=none \
-device virtio-9p-pci,fsdev=vmdata,mount_tag=data \
-drive file=/HD/bigfiles/fedora,format=qcow2,media=disk \
-cdrom /HD/images_iso_not_in_data/Fedora-Workstation-Live-x86_64-39-1.5.iso
I am wondering: do i miss an option to set up the network? However this was not necessary with version 6.2.
 
Old 12-08-2023, 05:47 PM   #2
pghvlaans
Member
 
Registered: Jan 2021
Distribution: Slackware64 {15.0,-current}, FreeBSD, stuff on QEMU
Posts: 462

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
The VM options look OK to me. A couple of ideas:
  1. Try installing libslirp and building Qemu with BRIDGE_HELPER_SETUID=yes
  2. What does /lib/udev/rules.d/65-kvm.rules look like?
 
2 members found this post helpful.
Old 12-08-2023, 07:03 PM   #3
ethelack
Member
 
Registered: Mar 2021
Location: New Zealand
Distribution: Slackware
Posts: 82

Rep: Reputation: Disabled
try adding (edit subnet as required)

-netdev user,id=n1,ipv4=on,ipv6=off,net=192.168.122.0/24,dhcpstart=192.168.122.6 -device virtio-net-pci,netdev=n1
 
Old 12-08-2023, 07:26 PM   #4
AlleyTrotter
Member
 
Registered: Jun 2002
Location: Coal Township PA
Distribution: Slackware64-15.0
Posts: 785

Rep: Reputation: 482Reputation: 482Reputation: 482Reputation: 482Reputation: 482
To enable user mode networking, install libslirp (availale on SBO), then
compile qemu:
Code:
SLIRP=yes ./qemu.SlackBuild
was the answer for me
HTH
john
 
3 members found this post helpful.
Old 12-08-2023, 07:45 PM   #5
chris.willing
Member
 
Registered: Jun 2014
Location: Sydney, Australia
Distribution: Slackware,LFS
Posts: 920

Rep: Reputation: 623Reputation: 623Reputation: 623Reputation: 623Reputation: 623Reputation: 623
From the qemu README,
Code:
To enable user mode networking, install libslirp (availale on SBO), then
compile qemu:

SLIRP=yes ./qemu.SlackBuild


edit: like AlleyTrotter said

Last edited by chris.willing; 12-08-2023 at 07:46 PM.
 
2 members found this post helpful.
Old 12-09-2023, 12:19 AM   #6
zeebra
Senior Member
 
Registered: Dec 2011
Distribution: Slackware
Posts: 1,834
Blog Entries: 17

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Quote:
Originally Posted by ethelack View Post
try adding (edit subnet as required)

-netdev user,id=n1,ipv4=on,ipv6=off,net=192.168.122.0/24,dhcpstart=192.168.122.6 -device virtio-net-pci,netdev=n1
That's pretty much how my autogenerated VM network part looks too, or less specifically.
Code:
-netdev user,id=name -device virtio-net-pci,netdev=name
With id=id, being any id I guess.. And I just do the dhcp part inside the VM.

It shouldn't be necessary to install slirp manually, it's included as part of QEMU, I'm pretty sure. At least I never had to install it, and my QEMU "user" network works just fine.

Last edited by zeebra; 12-09-2023 at 12:25 AM.
 
Old 12-09-2023, 05:09 AM   #7
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,077

Original Poster
Rep: Reputation: Disabled
Smile

Just setting SLIRP=yes worked, tried with two VMs, thanks all.

PS I forgot: Of course I first built and installed lislirp, and thanks to the SBo maintainers, contributors and admins. BTW everyone is welcome to take over the few scripts that still list me as maintainer though I abandoned them long ago.

Last edited by Didier Spaier; 12-09-2023 at 08:03 AM.
 
Old 12-09-2023, 06:53 AM   #8
chrisretusn
Senior Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware64-current
Posts: 2,987

Rep: Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557
This thread has me thinking of finally giving Qemu a try. Been on my list for while. I'm using VirtualBox, primarily for testing with Slackware. The real show stopper for me is my Windows 10 VM, pretty sure I'd have to keep VirtualBox for that. Worried about loosing my Windows 10 activation if I was to switch to Qemu.
 
Old 12-09-2023, 08:45 AM   #9
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,383

Rep: Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763Reputation: 2763
Quote:
The real show stopper for me is my Windows 10 VM, pretty sure I'd have to keep VirtualBox for that. Worried about loosing my Windows 10 activation if I was to switch to Qemu.
You cannot transfer a VirtualBox Windows 10 to a QEMU Windows 10.
You can source a cheap license.

Last edited by allend; 12-09-2023 at 08:48 AM.
 
Old 12-09-2023, 09:14 AM   #10
chrisretusn
Senior Member
 
Registered: Dec 2005
Location: Philippines
Distribution: Slackware64-current
Posts: 2,987

Rep: Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557Reputation: 1557
Quote:
Originally Posted by allend View Post
You cannot transfer a VirtualBox Windows 10 to a QEMU Windows 10.
You can source a cheap license.
Thanks!

Sigh... I suspected this. I don't use the VM but a few times a year anyway so not a big issue I was planning on keeping the VirtualBox install just for the Windows 10 VM. Everything else I use VirtualBox for I can just install in to QEMU.
 
Old 12-09-2023, 10:14 AM   #11
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,077

Original Poster
Rep: Reputation: Disabled
However you can use all these image formats in qemu:
Supported formats: blkdebug blklogwrites blkverify bochs cloop compress copy-before-write copy-on-read dmg file ftp ftps host_cdrom host_device http https luks nbd nfs null-aio null-co nvme parallels preallocate qcow qcow2 qed quorum raw replication snapshot-access ssh throttle vdi vhdx vmdk vpc vvfat

So if your VirtualBox virtual drive is in one of these formats you can just re-use it in Qemu, just indicating its format in the -drive option.

PS The 'qemu-img convert' sub-command also allows to convert the virtual drive's format to another one.

Last edited by Didier Spaier; 12-09-2023 at 10:20 AM. Reason: PS added.
 
1 members found this post helpful.
Old 12-09-2023, 12:02 PM   #12
Daedra
Senior Member
 
Registered: Dec 2005
Location: Springfield, MO
Distribution: Slackware64-15.0
Posts: 2,731

Rep: Reputation: 1393Reputation: 1393Reputation: 1393Reputation: 1393Reputation: 1393Reputation: 1393Reputation: 1393Reputation: 1393Reputation: 1393Reputation: 1393
Quote:
Originally Posted by chrisretusn View Post
This thread has me thinking of finally giving Qemu a try. Been on my list for while. I'm using VirtualBox, primarily for testing with Slackware. The real show stopper for me is my Windows 10 VM, pretty sure I'd have to keep VirtualBox for that. Worried about loosing my Windows 10 activation if I was to switch to Qemu.
You should definitely give it a try, I switched to Qemu/KVM last year and haven't looked back. And When you use virt-manager it is just as easy and straight forward as Virtualbox. Here is the sbopkg queue that I use to install it

Code:
osinfo-db-tools
osinfo-db
libosinfo
yajl
numactl
libvirt
libvirt-glib
libvirt-python
gtk-vnc
spice-protocol
spice
usbredir
spice-gtk
device-tree-compiler
libnfs
snappy
vde2
virglrenderer
libslirp
qemu
virt-manager
And speaking of the Windows 10 License, for the last 6 years I had been using the fifty or so left over Windows 7 keys I had to activate Windows 10. Microsoft finally closed that loophole two months ago, but you can find authentic Windows 10/11 keys all day long for around twenty or so dollars at places like g2a or even eBay.
 
3 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Set up qemu-kvm-1.0+noroms as spice enabled qemu server vs qemu-kvm-spice on Ubuntu Precise LXer Syndicated Linux News 0 05-26-2012 07:41 AM
Error while installing qemu (qemu-kvm-0.13.0) in rhel 5.3 birla.sunil Linux - Virtualization and Cloud 2 10-19-2010 03:56 AM
On qemu-kvm, qemu-ifup script not found on Slackware 13 AndrewGaven Linux - Virtualization and Cloud 14 01-29-2010 03:36 AM
After qemu-img, qemu is not capable to detect the C drive (empty) frenchn00b Linux - General 3 10-18-2009 05:39 AM
qemu: qemu stopped right after command exec bitpicker Linux - Software 1 03-04-2005 11:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration