WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Howto: qemu with networking  (Read 9993 times)

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14801
Howto: qemu with networking
« on: April 03, 2016, 04:36:21 AM »
It took a while to figure this out so, in case anybody else needs it...

Using the corepure64 qemu and bridge-utils extensions.

Setup a network bridge:
Code: [Select]
$ sudo modprobe bridge
$ sudo brctl addbr br0
$ sudo brctl addif br0 eth0
$ sudo ifconfig br0 up

..then startu qemu:
Code: [Select]
# echo 'allow br0' > /usr/local/etc/qemu/bridge.conf
$ qemu-img create -f qcow2 vdisk.img 2G
$ qemu-system-x86_64 -enable-kvm -hda vdisk.img -m 2G -cdrom CorePure64-7.0.iso -boot d -net nic -net bridge

..then tce-load -w/tce-load -i work fine from within the vm  :)

(for some reason wbar didn't want to work though)

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Howto: qemu with networking
« Reply #1 on: April 03, 2016, 05:00:08 AM »
The default doesn't work for you?

I do just
Code: [Select]
qemu-system-x86_64 -cdrom TinyCore.iso
And networking works just fine in the default user mode. It's slower than bridge, and doesn't support pings, but works fine for downloading things, web browsing, etc.

edit: Clarifying, this works both on other systems and CorePure64 for me.
« Last Edit: April 03, 2016, 05:06:48 AM by curaga »
The only barriers that can stop you are the ones you create yourself.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14801
Re: Howto: qemu with networking
« Reply #2 on: April 03, 2016, 06:50:56 AM »
Hmm - I tried ping and, when it didn't work, assumed networking didn't work - rookie mistake  :-[

That being said, the networking is so slow as to be unusuable - when trying "tce-load -w flwm", wget times out.

Edit: scrub that, the repo was down - it works on one of the mirrors
« Last Edit: April 03, 2016, 08:27:24 AM by Juanito »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14801
Re: Howto: qemu with networking
« Reply #3 on: April 11, 2016, 06:05:06 AM »
Continuing the <ahem> howto...

To share files between host and guest:

On the host use the following with nfs-server:
Code: [Select]
# echo '/mnt/nfs *(fsid=1,rw,no_root_squash,async,no_subtree_check,insecure)' > /usr/local/etc/exports
..and on the guest with nfs-client:
Code: [Select]
$ sudo mount.nfs -o nfsvers=3 10.0.0.2:/mnt/nfs /mnt/nfs