![]() |
|
||||
![]()
I wrote short qemu howto install/usage on FreeBSD as host os, and in this example with Win2000 as guest os.
changelog: 1. removed useless /etc/qemu-ifup script [it was used in older versions of qemu with tap/bridge interfaces]Install qemu with options showed below: Code:
# cd /usr/ports/emulators/qemu && make install clean Code:
Options for qemu: [X] KQEMU Build with (alpha!) accelerator module [ ] HACKS_CIRRUS Large display speedup (buggy!) [ ] RTL8139_TIMER allow use of re(4) nic with FreeBSD guests [ ] SAMBA samba dependency (for -smb) [X] SDL SDL/X dependency (graphical output) [X] CDROM_DMA IDE CDROM DMA Code:
# cd /usr/ports/security/sudo && make install clean Code:
# cat > /usr/local/etc/sudoers << EOF root ALL=(ALL) ALL username ALL=(ALL) NOPASSWD: ALL EOF load needed modules: Code:
# sudo kldload aio # sudo kldload kqemu Code:
% cat /dev/acd0 > ~/qemu/win2k.iso % dd bs=2048 if=/dev/acd0 of=~/qemu/win2k.iso Code:
% qemu-img create -f qcow2 ~/qemu/win2000.img 4G Code:
% qemu -boot d -hda ~/qemu/win2000.img -m 128 -cdrom ~/qemu/win2k.iso -win2k-hack -localtime Code:
% sudo kldunload kqemu % qemu -boot d -hda ~/qemu/win2000.img -m 128 -cdrom ~/qemu/win2k.iso -win2k-hack -localtime % sudo kldload kqemu Code:
% qemu -hda ~/qemu/win2000.img -m 256 -localtime Code:
% qemu -hda ~/qemu/win2000.img -m 256 -localtime -snapshot 2. to ensure that You use kqemu kernel module in user mode hit left_CTRL+left_ALT+2 and type info kqemu, if everything is ok You will see: Code:
kqemu support: enabled for user code Code:
kqemu support: disabled 3. to switch between qemu console and qemu os emualtion use left_CTRL+left_ALT+2 to go to console and left_CTRL+left_ALT+1 to back to emulation. 4. enabling network on emulated os, use DHCP configuration inside emulated os to get automatic IP adress 10.x.x.x after You quit You os inside emulated os, or by qemu console left_CTRL+left_ALT+2 and type quit use this command to launch again Your emulated OS: Code:
% qemu -hda ~/qemu/win2000.img -m 256 -localtime How to have sound in qemu OS, You just need to launch qemu the way I listed above, only with -soundhw sb16 or -soundhw es1370 to emulate Sound Blaster 16, or Sound Blaster 128. You can also enable standart annoying BEEP with -soundhw pcspk. You can also enable all three of them like that: -soundhw sb16,es1370,pcspk, or just BEEP + one of them: -soundhw es1370,pcspk, examples Code:
% qemu -hda ~/qemu/win2000.img -m 256 -localtime -soundhw pcspk Code:
% qemu -hda ~/qemu/win2000.img -m 256 -localtime -soundhw es1370,pcspk Code:
% qemu -hda ~/qemu/win2000.img -m 256 -localtime -soundhw es1370,pcspk,sb16 fluxbox add-on: in ~/.fluxbox/apps: Code:
# qemu [app] (class=SDL_App) [Workspace] {2} [Deco] {BORDER} [end] man qemu-img man qemu man aio man dd man cat http://kidsquid.com/cgi-bin/moin.cgi/QuickStartGuide http://qemu-forum.ipi.fi/qemu-snapshots/ http://qemu-forum.ipi.fi/ http://qemu.org/user-doc.html http://en.wikipedia.org/wiki/QEMU The same schema works for Solaris 10 and WindowsXP, You only do not use -win2k-hack. feel free to point errors, typo and Your hints/suggestions here.
__________________
religions, worst damnation of mankind "If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”. vermaden's: links resources deviantart spreadbsd Last edited by Carpetsmoker; 7th May 2008 at 06:43 AM. Reason: Fix title |
|
|||
![]()
Hey can I setup qemu up on NetBSD this way as well? I never emulation software before so I'm green ;-)
|
|
|||
![]() Quote:
Are their any memory requirements? I have only 256MB on my machine so would Xen run on my machine? |
|
||||
![]()
If you only have 256MB for both NetBSD/X, adding QEMU is probably not a great idea.
__________________
My Journal Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''. |
|
|||
![]()
what about xen then
|
|
|||
![]() Quote:
![]() |
|
||||
![]()
Ok, here is an example:
Windows XP requires a minimal of 64MB of RAM; 128MB is recommended (although how anyone could live with that on XP, is beyond me). So let us say, QEMU will be allowed 96MB of memory for running an Windows XP image. Let us further postulate, that between stumpwm and QEMU itself, a further 4MB of memory is consumed (fair enough? This will probably be a bit worse, depending on the size of the disk image used with QEMU). This leaves 156MB of memory free, not deducting memory space used by the Kernel, hardware resources, or incurred by file system related operations (a background fsck perhaps?). You will have to be running the X Windows System. A standard X.Org installation I believe, maps part or all of the gfx cards memory into it's own address space where possible; so memory usage on X.Org should be less then most things could ever report; I'm not familiar with NetBSDs X setup, but assume it would be similiar to normal X.Org/Xenocara. So, let us say at least 20MB of system memory for X. If your graphics card uses shared memory, like several (cheaper) ATI Xpress and Intel GMA cards do; that will increase the drain on system memory. X also should be caching image data used by programs, so that out to keep its memory usage lower.... So in reality, you've got closer to < 2/3 your memory to run other applications in. The exact memory used by programs is very hard to gauge, and the figures I've given are for the sake of *example* only. Needless to say, running things like OpenOffice, MS Office, Flash player, Mozilla, running a 3D game, encoding/decoding video, or building anything from ports or with GCC -- will further reduce your memory closer to swap space by a 'nice chunk'. In short: it helps drains system resources, which depending on your needs could someday become a problem sooner then later. FreeBSD is pretty efficient with it's usage of memory IMHO, but not always wise to push it to low memory situations. That is why I said, 'If you only have 256MB for both NetBSD/X, adding QEMU is probably not a great idea.' If one wants to run multiple OSes at once.... oy: much higher chance of getting into SWAP. Running Windows in QEMU with 96MB of RAM available to it, plus MS Office and IE6; alone would probably push XP into using SWAP file on the disk image. Most Linux or BSD systems, you'd want at least 64MB for QEMU... but ya get my point. You should really test it out before you commit to it, if you have a real need for using it in such a configuration; rather then a passing fancy. --> That is my 2 cents.
__________________
My Journal Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''. |
|
||||
![]() Quote:
http://www.netbsd.org/ports/xen/howto.html Code:
(...) # An entry for NetBSD/xen, using /netbsd as the domain0 kernel, and serial # console. Domain0 will have 64MB RAM allocated. # Assume NetBSD is installed in the first MBR partition. title Xen 3.0 / NetBSD (hda0, serial) root(hd0,0) kernel (hd0,a)/xen.gz dom0_mem=65536 com1=115200,8n1 module (hd0,a)/netbsd bootdev=wd0a ro console=ttyS0 (...)
__________________
religions, worst damnation of mankind "If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”. vermaden's: links resources deviantart spreadbsd |
|
|||
![]()
Add for x86_64/amd64 hosts.
# kldload kqemu aio if_tap if_bridge # sysctl net.link.tap.user_open=1 # ifconfig tap0 create # ifconfig bridge0 create ## example from my computer## vi /etc/devfs.rules #BiscuitBox Rules # [biscuitbox_rules=100] add path 'acd*' mode 666 #add path 'cd*' mode 666 #own tap0 moleque:moleque <-- remove the # from this line to where it looks like this: vi /etc/devfs.rules #BiscuitBox Rules # [biscuitbox_rules=100] add path 'acd*' mode 666 #add path 'cd*' mode 666 own tap0 moleque:moleque--> Save changes and exit. Jurgen suggested " Or if you really want to run qemu as root use something like kdesu to allow root to access your X display, or just do the following `hack': ln -sf ~yourlogin/.Xauthority ~ (as root.)" Use the qcow2 format for images. |
![]() |
Tags |
qemu |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
FreeBSD GPT howto | graudeejs | Guides | 10 | 21st December 2010 12:24 AM |
HOWTO: FreeBSD CPU Scaling with cpufreq.ko | vermaden | Guides | 10 | 27th October 2010 07:58 AM |
HOWTO: Enemy Territory on FreeBSD | tangram | Guides | 0 | 9th June 2009 03:31 PM |
HOWTO: FreeBSD with CCACHE | vermaden | Guides | 10 | 9th July 2008 06:14 PM |
ssh to FreeBSD run in Qemu | mfaridi | FreeBSD Security | 11 | 19th May 2008 01:00 PM |