Connecting to rpi in qemu via ssh

This forum is for topics specific to the Raspberry Pi and Arch Linux ARM

Connecting to rpi in qemu via ssh

Postby graysky » Mon Jul 16, 2012 1:29 pm

I can't ssh into my rpi running in qemu from my workstation.

$this->bbcode_second_pass_code('', '$ qemu-system-arm -M versatilepb -cpu arm1136-r2 -hda /mnt/data/vbox_hdd/rpi/archlinuxarm-13-06-2012.img -kernel /mnt/data/vbox_hdd/rpi/zImage-devtmpfs -m 512 -append root=/dev/sda2 -net nic -net user')

Within qemu, `ip addr` shows that the ip addy of the rpi image is 10.0.2.15 which is inaccessible from my workstation running on 192.168.1.2. What's the trick :)
graysky
Developer
 
Posts: 1876
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000

Re: Connecting to rpi in qemu via ssh

Postby WarheadsSE » Mon Jul 16, 2012 1:41 pm

Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: Connecting to rpi in qemu via ssh

Postby graysky » Mon Jul 16, 2012 3:04 pm

$this->bbcode_second_pass_quote('WarheadsSE', 'h')ttp://lmgtfy.com/?q=qemu+networking+howto

Links :) Just sayin


Ha, thanks for the push. I tried a number of suggestions from the 'net at large but nothing that worked.

*Assigned static addr in /etc/rc.conf and manually edited /etc/resolv.conf to match the host's settings. This resulted in a dead inet connection within the qemu box.

EDIT: perhaps the problem is that this image is using the old method to set /etc/resolv.conf which overwrites the file when the link comes up? Arch hasn't done this is a while so I can't remember how to fix it.
graysky
Developer
 
Posts: 1876
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000

Re: Connecting to rpi in qemu via ssh

Postby pepedog » Mon Jul 16, 2012 3:46 pm

/etc/resolv.conf.tail
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Connecting to rpi in qemu via ssh

Postby graysky » Mon Jul 16, 2012 3:54 pm

I added the correct nameservers to /etc/resolv.conf.tail w/ a static setup in /etc/rc.conf but am still unable to connect from the host.

As a side note, I found the setting that prevents the overwriting of /etc/resolv.conf
$this->bbcode_second_pass_code('', '$ cat /etc/conf.d/dhcpcd
DHCPCD_ARGS="-C resolv.conf -q"')

Anyway, if I switch back to a dhcp assigned network, I am confused how to tell qemu not to use the 10.x.x.x IP but instead to use a 192.168.0.x IP assigned by my router.
graysky
Developer
 
Posts: 1876
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000

Re: Connecting to rpi in qemu via ssh

Postby graysky » Mon Jul 16, 2012 7:02 pm

Is anyone in here using an up-to-date Arch host to run a qemu VM? If so, how did you configure the needed bridge now that net-tools is no longer supported? The Arch wiki teaches how to accomplish this using the antiquated software.

Thanks.
graysky
Developer
 
Posts: 1876
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000

Re: Connecting to rpi in qemu via ssh

Postby pepedog » Mon Jul 16, 2012 7:16 pm

What do you mean by bridge, multiple interfaces?
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Connecting to rpi in qemu via ssh

Postby graysky » Mon Jul 16, 2012 9:34 pm

$this->bbcode_second_pass_quote('pepedog', 'W')hat do you mean by bridge, multiple interfaces?


According to the Arch wiki on qemu, this is what I want for my network.

https://wiki.archlinux.org/index.php/Qemu
graysky
Developer
 
Posts: 1876
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000

Re: Connecting to rpi in qemu via ssh

Postby pepedog » Mon Jul 16, 2012 9:54 pm

netcfg
There might be one thing wrong in wiki, NETWORK in rc.conf has moved to /etc/rc.conf/netcfg
Network config in rc.conf is only for single interface.
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Connecting to rpi in qemu via ssh

Postby graysky » Tue Jul 17, 2012 5:04 am

$this->bbcode_second_pass_quote('pepedog', 'n')etcfg
There might be one thing wrong in wiki, NETWORK in rc.conf has moved to /etc/rc.conf/netcfg
Network config in rc.conf is only for single interface.


I do not have /etc/rc.conf/netcfg on my Arch x86_64 box at all. Step 5 in the link I setup states:

$this->bbcode_second_pass_quote('', '5'). Change your networking configuration so that you just bring up your real Ethernet adapter without configuring it, allowing real configuration to happen on the bridge interface. In /etc/rc.conf:

eth0="eth0 up"
br0="dhcp"
INTERFACES=(eth0 br0)

Remember, especially if you are doing DHCP, it is essential that the bridge comes up AFTER the real adapter, otherwise the bridge will not be able to talk to anything to get a DHCP address!
If you have been giving eth0 a static IP address rather than using DHCP, give br0 similar settings: /etc/rc.conf:

eth0="eth0 0.0.0.0"
br0="br0 192.168.0.3 netmask 255.255.255.0 broadcast 192.168.0.255"
INTERFACES=(eth0 br0)
gateway="default gw 192.168.0.1"
ROUTES=(gateway)

and then in /etc/resolv.conf:

domain lan
nameserver 192.168.0.1
My AUR packagesMy zsh configsStreamzap remote config
graysky
Developer
 
Posts: 1876
Joined: Sun Jun 26, 2011 6:56 am
Location: /run/user/1000
Top

Next

Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 2 guests