3

I'm having some issues getting Wheezy to work in QEMU. I've tried a lot of different combinations of arguments, all with the same results; this is the most recent I've tried.

> qemu-system-arm -kernel ../kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 console=ttyAMA0,115200 panic=1 rootfstype=ext4 rw init=/bin/bash" -soundhw ac97 -hda ../2015-02-16-raspbian-wheezy.img
WARNING: Image format was not specified for '../2015-02-16-raspbian-wheezy.img' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.
Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0x0
Linux version 3.10.26+ (shift@Shift-PC) (gcc version 4.7.3 (Gentoo 4.7.3-r1 p1.4, pie-0.5.5) ) #2 Fri Jan 17 22:13:59 EST 2014
CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d
CPU: VIPT aliasing data cache, unknown instruction cache
Machine: ARM-Versatile PB
Memory policy: ECC disabled, Data cache writeback
sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956ms
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 65024
Kernel command line: root=/dev/sda2 console=ttyAMA0,115200 panic=1 rootfstype=ext4 rw init=/bin/bash
PID hash table entries: 1024 (order: 0, 4096 bytes)
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 256MB = 256MB total
Memory: 254900k/254900k available, 7244k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    vmalloc : 0xd0800000 - 0xff000000   ( 744 MB)
    lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .text : 0xc0008000 - 0xc046af30   (4492 kB)
      .init : 0xc046b000 - 0xc048b714   ( 130 kB)
      .data : 0xc048c000 - 0xc04b69e0   ( 171 kB)
       .bss : 0xc04b69e0 - 0xc04d4aac   ( 121 kB)
NR_IRQS:224
VIC @f1140000: id 0x00041190, vendor 0x41
FPGA IRQ chip 0 "SIC" @ f1003000, 13 irqs
Console: colour dummy device 80x30
Calibrating delay loop... 528.38 BogoMIPS (lpj=2641920)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0xc0359758 - 0xc03597b4
devtmpfs: initialized
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
Serial: AMBA PL011 UART driver
dev:f1: ttyAMA0 at MMIO 0x101f1000 (irq = 44) is a PL011 rev1
console [ttyAMA0] enabled
dev:f2: ttyAMA1 at MMIO 0x101f2000 (irq = 45) is a PL011 rev1
dev:f3: ttyAMA2 at MMIO 0x101f3000 (irq = 46) is a PL011 rev1
fpga:09: ttyAMA3 at MMIO 0x10009000 (irq = 70) is a PL011 rev1
PCI core found (slot 11)
PCI host bridge to bus 0000:00
pci_bus 0000:00: root bus resource [mem 0x50000000-0x5fffffff]
pci_bus 0000:00: root bus resource [mem 0x60000000-0x6fffffff pref]
pci_bus 0000:00: root bus resource [io  0x1000-0xffff]
pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
PCI: bus0: Fast back to back transfers disabled
pci 0000:00:0c.0: BAR 2: assigned [mem 0x50000000-0x50001fff]
pci 0000:00:0c.0: BAR 1: assigned [mem 0x50002000-0x500023ff]
pci 0000:00:0d.0: BAR 0: assigned [io  0x1000-0x13ff]
pci 0000:00:0c.0: BAR 0: assigned [io  0x1400-0x14ff]
pci 0000:00:0d.0: BAR 1: assigned [io  0x1800-0x18ff]
bio: create slab <bio-0> at 0
vgaarb: loaded
SCSI subsystem initialized
Switching to clocksource timer3
NET: Registered protocol family 2
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP: reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
NetWinder Floating Point Emulator V0.97 (double precision)
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
NTFS driver 2.1.30 [Flags: R/W].
jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
ROMFS MTD (C) 2007 Red Hat, Inc.
msgmni has been set to 497
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
clcd-pl11x dev:20: PL110 rev0 at 0x10120000
clcd-pl11x dev:20: Versatile hardware, VGA display
Console: switching to colour frame buffer device 80x30
brd: module loaded
loop: module loaded
PCI: enabling device 0000:00:0c.0 (0100 -> 0103)
sym0: <895a> rev 0x0 at pci 0000:00:0c.0 irq 93
sym0: No NVRAM, ID 7, Fast-40, LVD, parity checking
sym0: SCSI BUS has been reset.
scsi0 : sym-2.2.3
sym0: unknown interrupt(s) ignored, ISTAT=0x5 DSTAT=0x80 SIST=0x0
scsi 0:0:0:0: Direct-Access     QEMU     QEMU HARDDISK    2.2. PQ: 0 ANSI: 5
scsi target0:0:0: tagged command queuing enabled, command queue depth 16.
scsi target0:0:0: Beginning Domain Validation
scsi target0:0:0: Domain Validation skipping write tests
scsi target0:0:0: Ending Domain Validation
scsi 0:0:2:0: CD-ROM            QEMU     QEMU CD-ROM      2.2. PQ: 0 ANSI: 5
scsi target0:0:2: tagged command queuing enabled, command queue depth 16.
scsi target0:0:2: Beginning Domain Validation
scsi target0:0:2: Domain Validation skipping write tests
scsi target0:0:2: Ending Domain Validation
sr0: scsi3-mmc drive: 16x/50x cd/rw xa/form2 cdda tray
cdrom: Uniform CD-ROM driver Revision: 3.20
physmap platform flash device: 04000000 at 34000000
physmap-flash.0: Found 1 x32 devices at 0x0 in 32-bit bank. Manufacturer ID 0x000000 Chip ID 0x000000
Intel/Sharp Extended Query Table at 0x0031
Using buffer write method
sd 0:0:0:0: [sda] 6400000 512-byte logical blocks: (3.27 GB/3.05 GiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sda: sda1 sda2
sd 0:0:0:0: [sda] Attached SCSI disk
smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre <nico@fluxnic.net>
eth0: SMC91C11xFD (rev 1) at d09d8000 IRQ 57 [nowait]
eth0: Ethernet addr: 52:54:00:12:34:56
mousedev: PS/2 mouse device common for all mice
TCP: cubic registered
NET: Registered protocol family 17
VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5
input: AT Raw Set 2 keyboard as /devices/fpga:06/serio0/input/input0
input: ImExPS/2 Generic Explorer Mouse as /devices/fpga:07/serio1/input/input1
EXT4-fs (sda2): recovery complete
EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)
VFS: Mounted root (ext4 filesystem) on device 8:2.
devtmpfs: mounted
Freeing unused kernel memory: 128K (c046b000 - c048b000)
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell

At this point, if I run "sudo raspi-config", I get "unable to resolve host name (none)". But it does let me log in.

root@(none):/# login
(none) login: pi
Password: 
Last login: Thu Jan  1 00:00:53 UTC 1970 on UNKNOWN
Linux (none) 3.2.0 #1 Sun Jan 29 03:14:15 CST 2012 armv6l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
-bash: no job control in this shell

NOTICE: the software on this Raspberry Pi has not been fully configured. Please run 'sudo raspi-config'

root@(none):/# sudo: unable to resolve host (none)

The last line is another attempt to run "sudo raspi-config", but you can't see what I typed, because none of my inputs appear from then on. If I enter gibberish and hit enter, it shows me what I typed in the error, but the line where I was typing is still empty.

This happens whether I use my real terminal or the emulation window as my output (omit "console=...").

Investigating the "none" host name:

root@(none):/# cat /etc/hosts
127.0.0.1       localhost
::1             localhost ip6-localhost ip6-loopback
fe00::0         ip6-localnet
ff00::0         ip6-mcastprefix
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters

127.0.1.1       raspberrypi
root@(none):/# cat /etc/hostname
raspberrypi

I can't tell if these problems are connected. This is the closest I've gotten to a working Raspberry Pi emulation, and I've followed all the tutorials and troubleshooting posts I found that seemed related. Does anyone know what I'm doing wrong?

> qemu-system-arm --version
QEMU emulator version 2.2.50, Copyright (c) 2003-2008 Fabrice Bellard

> lsb_release -a
No LSB modules are available.
Distributor ID: LinuxMint
Description:    Linux Mint 17.1 Rebecca
Release:        17.1
Codename:       rebecca

I just tried resizing the .img, to no avail. The only difference between my result and the tutorial I was reading is that my newly resized image had the same disk size and virtual size, 4.16 GB, instead of the original, 3.16 GB. In the tutorial, the virtual size was the only increased size.

2

I had the exact same issue using bash as init. This will get you access to the system, but as you've seen login and some other stuff won't work.

Per the instructions at http://xecdesign.com/qemu-emulating-raspberry-pi-the-easy-way/ you need to comment out a line in /etc/ld.so.preload.

After this a normal boot without a custom init will work mostly (I have to Control+D the recovery shell at boot)

  • If you want to run a lot of images in QEMU you may want to use a small bash script available for download on the following page (linux-tips-and-tricks.de/en/raspberry/…) which updates an existing image (including conversion into qcow2 format and disk size increase) in 1 second so it's ready to be started in the QEMU emulator. – framp Apr 14 '15 at 19:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.