You are on page 1of 3

Gett|ng LMU to run AkM vm-|mage on W|ndows

Ior use w|th the CpenSecur|ty1ra|n|ng.|nfo]IntroAkM.htm| c|ass


8y Ieff 1am

Lnv|ronments
8unnlng CLMu on Wlndows
8ulldlng A8M vm-lmage on Llnux envlronmenL

Sett|ng up LMU (W|ndows)
uownload laLesL CLMu blnarles: hLLp://wlkl.qemu.org/Maln_age
uownload C1k+: hLLp://www.gLk.org/download/wln32.php


Creat|ng the AkM vm-|mage (L|nux)
1he followlng ls a summary of & appllcaLlon of Lhe lnsLrucLlons from: hLLps://developer.mozllla.org/en-
uS/docs/ueveloper_Culde/vlrLual_A8M_Llnux_envlronmenL

Lnv|ronment Setup
# Add Llnaro's reposlLory, conLalnlng Lhelr Lools and more recenL verslons of qemu
sudo add-apL-reposlLory ppa:llnaro-malnLalners/Lools
sudo apL-geL updaLe
# lnsLall llnaro Lools and qemu
sudo apL-geL lnsLall llnaro-lmage-Lools qemu-user-sLaLlc qemu-sysLem

# lf you wanL Lo be able Lo cross-complle on Lhe hosL, lnsLall Lhese as well
Sudo apL-geL lnsLall gcc-arm-llnux-gnueabl g++-arm-llnux-gnueab

# Add Llnaro's reposlLory, conLalnlng Lhelr Lools and more recenL
# verslons of qemu (you need aL leasL qemu 0.13*).
sudo add-apL-reposlLory ppa:llnaro-malnLalners/Lools
# lnsLall llnaro Lools and qemu
sudo apL-geL lnsLall llnaro-lmage-Lools qemu-user-sLaLlc qemu-sysLem

# lf you wanL Lo be able Lo cross-complle on Lhe hosL, lnsLall Lhese as well
sudo apL-geL lnsLall gcc-arm-llnux-gnueabl g++-arm-llnux-gnueab
# or you can lnsLall CodeSourcery/A8M-Llnux Loolchaln

Down|oad a L|naro re|ease & hardware pack
wgeL hLLp://releases.llnaro.org/plaLform/llnaro-n/nano/alpha-3/llnaro-naLLy-nano-Lar-20110302-
0.Lar.gz
wgeL hLLp://releases.llnaro.org/plaLform/llnaro-n/hwpacks/alpha-3/hwpack_llnaro-vexpress_20110302-
0_armel_supporLed.Lar.gz

Create the |mage
llnaro-medla-creaLe --lmage_flle vexpress.lmg --dev vexpress --blnary llnaro-naLLy-nano-Lar-20110302-
0.Lar.gz --hwpack hwpack_llnaro-vexpress_20110302-0_armel_supporLed.Lar.gz

Lxtract|ng the kerne| and |n|trd
# 1he creaLed lmage conLalns Lhe needed kernel and lnlLrd of Lhe A8M vm
# 1he followlng mounLs Lhe lmage Lo /mnL/Lmp"
sudo mounL -o loop,offseL="$(flle vexpress.lmg | awk '8LCln [ 8S=",", } /parLlLlon 2/ [ prlnL $7*312, }')" -
L auLo vexpress.lmg /mnL/Lmp

# 1he wanLed flles are llnked Lo by /mnL/Lmp/vmllnuz" (kernel) & /mnL/Lmp/lnlLrd.lmg" (lnlLrd)
# 1ransfer vexpress.lmg, vmllnuz, & lnlLrd Lo Lhe Wlndows box/hosL
# 8enamed Lo vmllnuz & lnlLrd.lmg


Start|ng LMU (W|ndows)
qemu-sysLem-arm -M vexpress-a9 -cpu corLex-a9 -kernel ./vmllnuz -lnlLrd ./lnlLrd.lmg -redlr
Lcp:2200::22 -m 312 -append "rooL=/dev/mmcblk0p2 vga=normal mem=312M devLmpfs.mounL=0 rw"
-drlve flle=vexpress.lmg,lf=sd,cache=wrlLeback

noLes:
1he -redlr Lcp:2200::22" redlrecLs 1C Lrafflc on Lhe hosL porL 2200 Lo Lhe guesL machlne
(CLMu) porL 22. 1hls wlll allow us Lo SSP lnLo Lhe machlne laLer by connecLlng Lo localhosL on
2200.
1he -m 312" speclfles LhaL we wanL 312 M8 of 8AM. ?ou can ad[usL Lhls, buL make sure you
also change lL ln Lhe -append" sLrlng.
1he -drlve flle=vexpress.lmg,lf=sd,cache=wrlLeback" aLLaches our lmages as an Su card.
(Supposedly provldes fasLer l/C)


Sett|ng up A1-repos|tor|es
# lf you are uslng an older verslon of ubunLu as Lhe vm (ouL of supporL, eLc)
# edlL sources.llsL" Lo use old-releases.ubunLu.com/ubunLu"
vl /eLc/apL/sources.llsL


Sett|ng up SSn on the vm (VM)
Lnab|e a network connect|on
lfconflg eLh0 up
dhcllenL eLh0

Insta|| SSn
apL-geL lnsLall openssh-server

ers|st network changes
auLo eLh0
lface eLh0 lneL dhcp

noLes:
SeL a password for rooL (passwd" cmd)
SSP vla ssh -p2200 rooL[localhosL" on Lhe hosL (Wlndows) machlne


Insta|||ng needed packages
apL-geL lnsLall llbpLhread-sLubs0
apL-geL lnsLall gcc
apL-geL lnsLall g++
apL-geL lnsLall make


keferences
CLMu: hLLp://wlkl.qemu.org/Maln_age
C1k+: hLLp://www.gLk.org/download/wln32.php
A8M vm-lmage & CLMu sLarLup: hLLps://developer.mozllla.org/en-
uS/docs/ueveloper_Culde/vlrLual_A8M_Llnux_envlronmenL

You might also like