Code: Select all
qemu-sysnel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1" -hda /media/it_drive/VirtualBox/qtemu/2012-10-28-wheezy-raspbian.img -redir tcp:5022::22
the redir tcp line is to make Qemu accept SSH on port 5022 on the host directed to port 22 on the guest. Nothing to do with screen size.exup wrote:one other thing, I am not an expert on QEMU but is it possible to increase the screen size of the session. I suspect its to do with the command line -redir tcp:5022::22 but not sure what numbers to plug in.
I assume you could. Just try it. My personal goal is to emulate a Pi, so I only need/want 256MB, as I don't want to have more resources in that respect than a real Pi.exup wrote:Also can you increase RAM sizes, is that the -m 256 could you make it -m 1024
I am using Qemu to test routines in BRPI. I can trash and bork a system to my hearts content, and just copy a new filesystem over in 10 seconds flat to get it back to a fresh install.pluggy wrote:I'm trying to think of a good reason to emulate the comparatively crappy Pi experience on something that runs far better natively......
tulumbas wrote:tonyhughes, what version of qemu is used in your Ubuntu?... because in Debian wheezy qemu is just 0.9 and doesn't know 1176 cpu...
Code: Select all
colleen@colleen-laptop:~$ dpkg -s qemu-system Package: qemu-system Status: install ok installed Priority: optional Section: misc Installed-Size: 48930 Maintainer: Ubuntu Developers <email@example.com> Architecture: i386 Source: qemu-linaro Version: 1.2.0-2012.09-0ubuntu1
Nope, that won't work.Liber wrote:Hi,
Is QEMU able to fully emulate GPU of Raspberry Pi ?( I would like to run a game.)
Code: Select all
How to chroot RPI envoronment. Keep in mind this took me so many hours to figure out it's not even funny. I'm not exactly a nix guru by any means of the word. The 1st part sucks as it is how you get the img ready. There are two ways to do it but I found it easier just to do it this way. The hard way is to use gemu to expand the img file and then some fancy fdisk stuff in the image to expand. Pfft My Way: I do this part all in windows so if you're a linux user you will need to know how to do dd and other linuxy things. Download the latest Raspbian 2013-02-09-wheezy-raspbian.img from http://www.raspberrypi.org/downloads http://downloads.raspberrypi.org/images/raspbian/2013-02-09-wheezy-raspbian/2013-02-09-wheezy-raspbian.zip unzip it. Write to your SD Card [8 gig is plenty ] I use win32diskimager Once completed insert SD into your RPI and boot it. Run through initial setup screen paying attention to the "expand rootfs" as this one is really the only one of two parts that matter. Run the last option which is like try to update. Exit and reboot log in sudo apt-get install git-core sudo wget http://goo.gl/1BOfJ -O /usr/bin/rpi-update && sudo chmod +x /usr/bin/rpi-update sudo rpt-update and let it do it's thing you CAN do an apt-get update && apt-get dist-upgrade now but it takes forever, much faster to do it once it's chrooted !!this part is VERY important with 2013-02-09 sudo nano /etc/ld.so.preload comment out anything in there. If you do not then it will bork when you try to run nearly any command with the following error: qemu: uncaught target signal 4 (Illegal instruction) - core dumped Illegal instruction (core dumped) ok all done with the prepping of the image sudo shutdown -h now pull the SD card and put it in your reader. Again I use win32diskimager read it to an image. I named it the same as the original 2013-02-09-wheezy-raspbian.img when it's done writing the image [and it WILL take a while] you can pull the SD on the nix box sudo apt-get install qemu qemu-user qemu-user-static kpartx I put all my Raspi images in /rpi-images and I mount it in /mnt/temp so sudo mkdir /rpi-images sudo mkdir /mnt/temp sudo chmod -R 777 /rpi-images transfer your newly created image into /rpi-images now create the following scripts [mountrpi] #! /bin/bash kpartx -a -v /rpi-images/2013-02-09-wheezy-raspbian.img mount /dev/mapper/loop0p2 /mnt/temp cp /usr/bin/qemu-arm-static /mnt/temp/usr/bin mount -o bind /dev /mnt/temp/dev mount -o bind /dev/pts /mnt/temp/dev/pts mount -o bind /proc /mnt/temp/proc mount -o bind /sys /mnt/temp/sys mount -o bind /run /mnt/temp/run #sets up the interfaces cp /etc/network/interfaces /mnt/temp/etc/network/interfaces #makes networking actually work cp /etc/resolv.conf /mnt/temp/etc/resolv.conf #where the magic happens echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:' > /proc/sys/fs/binfmt_misc/register chroot /mnt/temp [umountrpi] #! /bin/bash cd /devel umount -l /mnt/temp/dev/pts umount -l /mnt/temp/dev umount -l /mnt/temp/proc umount -l /mnt/temp/sys umount -l /mnt/temp/run umount -l /mnt/temp kpartx -d -v /rpi-images/2013-02-09-wheezy-raspbian.img make then executable sudo chmod +x mountrpi umountrpi ok you are now ready for the magic. But as a note I had issues trying this with sudo so jus do it as root. ie:su [password] then just run ./mountrpi if you followed my directions to a T you are now in your new chrooted raspbian environment test it by uname -a Linux jothee 2.6.32 #42-Ubuntu SMP Fri Mar 8 23:20:06 UTC 2013 armv7l GNU/Linux you can now do everyhing just as if you are running on your RPI. I tend to do a rpi-update just to make sure everything is good to go and also do a apt-get update && apt-get dist-upgrade now to unmount just type exit [enter] and then sudo ./umountrpi Word of warning, you are ROOT when doing this on the rpi chroot so you CAN royally screw up the image if you're not careful. as in do not try rm -rf / because it WILL at this point you are ready to set up your xbmc build environment which is icky. I will follow up with that in the next post!
I'll start a new thread later today with a bit more info on how to do it, such as how to edit the file in etc if you don't do it before creating the image. I'll also add how to use qemu to expand the image in case peeps don't have windows available. Plus I have to remember [read look up] how to do it using qemu as it's been a while since I did it that way.tonyhughes wrote:Valuable info above, which is absolutely worth its own thread, or people who arent running Linux might never see it...