SlideShare a Scribd company logo
Qemu in Chroot
Make it easy
QEMU is a hosted virtual machine
monitor: It emulates central processing
units through dynamic binary translation
and provides a set of device models,
enabling it to run a variety of unmodified
guest operating systems.
Qemu
A chroot on Unix operating
systems is an operation that
changes the apparent root
directory for the current running
process and its children.
Chroot
The Raspberry Pi has a
Broadcom BCM2835 system on
a chip (SoC),[3] which includes
an ARM1176JZF-S 700 MHz
processor
Raspberry Pi
What about speed?
pi@raspberrypi:~$ cat /proc/cpuinfo | grep MIPS
BogoMIPS

: 697.95

pi@raspberrypi:~$ cat /proc/cpuinfo | grep MIPS
BogoMIPS

Not good!

: 565.24
Qemu compilation
ARM1176JZF-S

#
#
#
#

git clone http://git.qemu.org/git/qemu.git
./configure --target-list="arm-softmmu arm-linux-user" --enable-sdl --static
make
sudo make install
Preparation
●
●

Download the latest version of Raspbian (link)
Download the linux kernel for Qemu (link)

# qemu-system -kernel kernel-qemu -cpu arm1176 -M versatilepb -no-reboot -append
"root=/dev/sda2 panic=0 ro single" -hda XXXXX-raspbian.img
# mount / -o remount,rw

●
●

Edit fstab and change mmcblk0p1 and mmcblk0p2 to sda1
and sda2 respectively
Create /etc/udev/rules.d/90-qemu.rules

KERNEL=="sda", SYMLINK+="mmcblk0"
KERNEL=="sda?", SYMLINK+="mmcblk0p%n",

●

Comment everything in /etc/ld.so.preload
Enlarge it!

# cp XXXXX-raspbian.img raspbian.img
# qemu-img resize raspbian.img +6G
# qemu-system -kernel kernel-qemu -cpu arm1176 -M versatilepb -no-reboot -append "root=/dev/sda2 panic=1"
-hda XXXXX-raspbian.img -hdb raspbian.img
# sudo cfdisk /dev/sdb

●Delete the second partition and create a new partition with all space
# sudo resize2fs /dev/sdb2
# sudo fsck -f /dev/sdb2
# sudo halt
# qemu-system -kernel kernel-qemu -cpu arm1176 -M versatilepb -no-reboot -append "root=/dev/sda2 panic=1"
-hda raspbian.img
Chroot it
# sudo kpartx -a -v 2012-12-16-wheezy-raspbian.img
add map loop0p1 (252:8): 0 114688 linear /dev/loop0 8192
add map loop0p2 (252:9): 0 5763072 linear /dev/loop0 122880
# sudo mount /dev/mapper/loop0p2 /mnt/temp# sudo mount -o bind /dev /mnt/temp/dev
# sudo mount -o bind /proc /mnt/temp/proc
# sudo mount -o bind /sys /mnt/temp/sys

Don’t forget to copy the qemu-arm binary to the image
# sudo cp /usr/bin/qemu-arm /mnt/temp/usr/bin

# cat /usr/share/binfmts/qemu-arm
package qemu-user-static
interpreter /usr/bin/qemu-arm-static
credentials yes
offset 0
magic x7fELFx01x01x01x00x00x00x00x00x00x00x00x00x02x00x28x00
mask xffxffxffxffxffxffxffx00xffxffxffxffxffxffxffxffxfexffxffxff

Run sudo update-binfmts --import qemu-arm two times (yes, two times)
And we are good to go

Now, you should be able to chroot
# sudo chroot /mnt/temp

Let’s check if it’s working
# uname -a
Linux localhost 2.6.32 #58-Ubuntu SMP Thu Jan 24 15:28:10 UTC 2013 armv7l GNU/Linux

More Related Content

What's hot

Multi-GPU MapReduce on GPU Clusters
Multi-GPU MapReduce on GPU ClustersMulti-GPU MapReduce on GPU Clusters
Multi-GPU MapReduce on GPU Clusters
Dr. Jaegwang Lim
 
NetBSD on Google Compute Engine (en)
NetBSD on Google Compute Engine (en)NetBSD on Google Compute Engine (en)
NetBSD on Google Compute Engine (en)
Ryo ONODERA
 
My First BCC
My First BCCMy First BCC
My First BCC
Naoto MATSUMOTO
 
SiteGround Tech TeamBuilding
SiteGround Tech TeamBuildingSiteGround Tech TeamBuilding
SiteGround Tech TeamBuilding
Marian Marinov
 
Control-M 800 - Infrastructure Example
Control-M 800 - Infrastructure ExampleControl-M 800 - Infrastructure Example
Control-M 800 - Infrastructure Example
Ohio University
 
Asus WL500gP USB Serial
Asus WL500gP USB SerialAsus WL500gP USB Serial
Asus WL500gP USB Serialguestac21b8
 
Trivadis TechEvent 2016 cgroups im Einsatz von Florian Feicht
Trivadis TechEvent 2016 cgroups im Einsatz von Florian FeichtTrivadis TechEvent 2016 cgroups im Einsatz von Florian Feicht
Trivadis TechEvent 2016 cgroups im Einsatz von Florian Feicht
Trivadis
 
Linux fundamental - Chap 16 System Rescue
Linux fundamental - Chap 16 System RescueLinux fundamental - Chap 16 System Rescue
Linux fundamental - Chap 16 System Rescue
Kenny (netman)
 
Nvprof um 1
Nvprof um 1Nvprof um 1
Nvprof um 1
Josh Wyatt
 
Androidx86 Installation For Virtualbox
Androidx86 Installation For VirtualboxAndroidx86 Installation For Virtualbox
Androidx86 Installation For VirtualboxPingLun Liao
 
DataStax: 7 Deadly Sins for Cassandra Ops
DataStax: 7 Deadly Sins for Cassandra OpsDataStax: 7 Deadly Sins for Cassandra Ops
DataStax: 7 Deadly Sins for Cassandra Ops
DataStax Academy
 
1. openvpn simple
1. openvpn simple1. openvpn simple
1. openvpn simplekhanh02l1
 
Troubleshooting linux booting process
Troubleshooting linux booting processTroubleshooting linux booting process
Troubleshooting linux booting process
Manolis Kartsonakis
 
redis-benchmark with AMD RYZEN 1800X memo
redis-benchmark with AMD RYZEN 1800X memoredis-benchmark with AMD RYZEN 1800X memo
redis-benchmark with AMD RYZEN 1800X memo
Naoto MATSUMOTO
 
Linux: Hardware Settings
Linux: Hardware SettingsLinux: Hardware Settings
Linux: Hardware Settings
John Ombagi
 
Comparison of-foss-distributed-storage
Comparison of-foss-distributed-storageComparison of-foss-distributed-storage
Comparison of-foss-distributed-storage
Marian Marinov
 
Nvvp streams-2
Nvvp streams-2Nvvp streams-2
Nvvp streams-2
Josh Wyatt
 

What's hot (20)

Multi-GPU MapReduce on GPU Clusters
Multi-GPU MapReduce on GPU ClustersMulti-GPU MapReduce on GPU Clusters
Multi-GPU MapReduce on GPU Clusters
 
NetBSD on Google Compute Engine (en)
NetBSD on Google Compute Engine (en)NetBSD on Google Compute Engine (en)
NetBSD on Google Compute Engine (en)
 
My First BCC
My First BCCMy First BCC
My First BCC
 
Kvm optimizations
Kvm optimizationsKvm optimizations
Kvm optimizations
 
SiteGround Tech TeamBuilding
SiteGround Tech TeamBuildingSiteGround Tech TeamBuilding
SiteGround Tech TeamBuilding
 
Control-M 800 - Infrastructure Example
Control-M 800 - Infrastructure ExampleControl-M 800 - Infrastructure Example
Control-M 800 - Infrastructure Example
 
Asus WL500gP USB Serial
Asus WL500gP USB SerialAsus WL500gP USB Serial
Asus WL500gP USB Serial
 
Trivadis TechEvent 2016 cgroups im Einsatz von Florian Feicht
Trivadis TechEvent 2016 cgroups im Einsatz von Florian FeichtTrivadis TechEvent 2016 cgroups im Einsatz von Florian Feicht
Trivadis TechEvent 2016 cgroups im Einsatz von Florian Feicht
 
Linux fundamental - Chap 16 System Rescue
Linux fundamental - Chap 16 System RescueLinux fundamental - Chap 16 System Rescue
Linux fundamental - Chap 16 System Rescue
 
Nvprof um 1
Nvprof um 1Nvprof um 1
Nvprof um 1
 
coreboot@Budapest 10.2009 Meetup
coreboot@Budapest 10.2009 Meetupcoreboot@Budapest 10.2009 Meetup
coreboot@Budapest 10.2009 Meetup
 
Androidx86 Installation For Virtualbox
Androidx86 Installation For VirtualboxAndroidx86 Installation For Virtualbox
Androidx86 Installation For Virtualbox
 
DataStax: 7 Deadly Sins for Cassandra Ops
DataStax: 7 Deadly Sins for Cassandra OpsDataStax: 7 Deadly Sins for Cassandra Ops
DataStax: 7 Deadly Sins for Cassandra Ops
 
1. openvpn simple
1. openvpn simple1. openvpn simple
1. openvpn simple
 
Troubleshooting linux booting process
Troubleshooting linux booting processTroubleshooting linux booting process
Troubleshooting linux booting process
 
redis-benchmark with AMD RYZEN 1800X memo
redis-benchmark with AMD RYZEN 1800X memoredis-benchmark with AMD RYZEN 1800X memo
redis-benchmark with AMD RYZEN 1800X memo
 
Linux: Hardware Settings
Linux: Hardware SettingsLinux: Hardware Settings
Linux: Hardware Settings
 
testing-nfs
testing-nfstesting-nfs
testing-nfs
 
Comparison of-foss-distributed-storage
Comparison of-foss-distributed-storageComparison of-foss-distributed-storage
Comparison of-foss-distributed-storage
 
Nvvp streams-2
Nvvp streams-2Nvvp streams-2
Nvvp streams-2
 

Similar to Qemu - Raspberry | while42 Singapore #2

3. configuring a compute node for nfv
3. configuring a compute node for nfv3. configuring a compute node for nfv
3. configuring a compute node for nfv
videos
 
Raspberry Pi tutorial
Raspberry Pi tutorialRaspberry Pi tutorial
Raspberry Pi tutorial
艾鍗科技
 
Linux Containers From Scratch
Linux Containers From ScratchLinux Containers From Scratch
Linux Containers From Scratch
joshuasoundcloud
 
Kernel Recipes 2015 - Kernel dump analysis
Kernel Recipes 2015 - Kernel dump analysisKernel Recipes 2015 - Kernel dump analysis
Kernel Recipes 2015 - Kernel dump analysis
Anne Nicolas
 
x86_64 Hardware Deep dive
x86_64 Hardware Deep divex86_64 Hardware Deep dive
x86_64 Hardware Deep dive
Naoto MATSUMOTO
 
Qt native built for raspberry zero
Qt native built for  raspberry zeroQt native built for  raspberry zero
Qt native built for raspberry zero
SoheilSabzevari2
 
Cacti安装手册
Cacti安装手册Cacti安装手册
Cacti安装手册Yiwei Ma
 
9 creating cent_os 7_mages_for_dpdk_training
9 creating cent_os 7_mages_for_dpdk_training9 creating cent_os 7_mages_for_dpdk_training
9 creating cent_os 7_mages_for_dpdk_training
videos
 
NFD9 - Matt Peterson, Data Center Operations
NFD9 - Matt Peterson, Data Center OperationsNFD9 - Matt Peterson, Data Center Operations
NFD9 - Matt Peterson, Data Center Operations
Cumulus Networks
 
MINCS - containers in the shell script (Eng. ver.)
MINCS - containers in the shell script (Eng. ver.)MINCS - containers in the shell script (Eng. ver.)
MINCS - containers in the shell script (Eng. ver.)
Masami Hiramatsu
 
Docker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in PragueDocker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in Prague
tomasbart
 
Linux Tracing Superpowers by Eugene Pirogov
Linux Tracing Superpowers by Eugene PirogovLinux Tracing Superpowers by Eugene Pirogov
Linux Tracing Superpowers by Eugene Pirogov
Pivorak MeetUp
 
CloudStack hands-on workshop @ DevOpsDays Amsterdam 2015
CloudStack hands-on workshop @ DevOpsDays Amsterdam 2015CloudStack hands-on workshop @ DevOpsDays Amsterdam 2015
CloudStack hands-on workshop @ DevOpsDays Amsterdam 2015
Remi Bergsma
 
PFIセミナー資料 H27.10.22
PFIセミナー資料 H27.10.22PFIセミナー資料 H27.10.22
PFIセミナー資料 H27.10.22
Yuya Takei
 
Linux Crash Dump Capture and Analysis
Linux Crash Dump Capture and AnalysisLinux Crash Dump Capture and Analysis
Linux Crash Dump Capture and Analysis
Paul V. Novarese
 
How to Burn Multi-GPUs using CUDA stress test memo
How to Burn Multi-GPUs using CUDA stress test memoHow to Burn Multi-GPUs using CUDA stress test memo
How to Burn Multi-GPUs using CUDA stress test memo
Naoto MATSUMOTO
 
Docker practice
Docker practiceDocker practice
Docker practice
wonyong hwang
 
NetBSD workshop
NetBSD workshopNetBSD workshop
NetBSD workshop
Jun Ebihara
 
qemu + gdb: The efficient way to understand/debug Linux kernel code/data stru...
qemu + gdb: The efficient way to understand/debug Linux kernel code/data stru...qemu + gdb: The efficient way to understand/debug Linux kernel code/data stru...
qemu + gdb: The efficient way to understand/debug Linux kernel code/data stru...
Adrian Huang
 

Similar to Qemu - Raspberry | while42 Singapore #2 (20)

3. configuring a compute node for nfv
3. configuring a compute node for nfv3. configuring a compute node for nfv
3. configuring a compute node for nfv
 
Raspberry Pi tutorial
Raspberry Pi tutorialRaspberry Pi tutorial
Raspberry Pi tutorial
 
Linux Containers From Scratch
Linux Containers From ScratchLinux Containers From Scratch
Linux Containers From Scratch
 
Kernel Recipes 2015 - Kernel dump analysis
Kernel Recipes 2015 - Kernel dump analysisKernel Recipes 2015 - Kernel dump analysis
Kernel Recipes 2015 - Kernel dump analysis
 
x86_64 Hardware Deep dive
x86_64 Hardware Deep divex86_64 Hardware Deep dive
x86_64 Hardware Deep dive
 
Qt native built for raspberry zero
Qt native built for  raspberry zeroQt native built for  raspberry zero
Qt native built for raspberry zero
 
Cacti安装手册
Cacti安装手册Cacti安装手册
Cacti安装手册
 
9 creating cent_os 7_mages_for_dpdk_training
9 creating cent_os 7_mages_for_dpdk_training9 creating cent_os 7_mages_for_dpdk_training
9 creating cent_os 7_mages_for_dpdk_training
 
NFD9 - Matt Peterson, Data Center Operations
NFD9 - Matt Peterson, Data Center OperationsNFD9 - Matt Peterson, Data Center Operations
NFD9 - Matt Peterson, Data Center Operations
 
MINCS - containers in the shell script (Eng. ver.)
MINCS - containers in the shell script (Eng. ver.)MINCS - containers in the shell script (Eng. ver.)
MINCS - containers in the shell script (Eng. ver.)
 
Docker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in PragueDocker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in Prague
 
Linux Tracing Superpowers by Eugene Pirogov
Linux Tracing Superpowers by Eugene PirogovLinux Tracing Superpowers by Eugene Pirogov
Linux Tracing Superpowers by Eugene Pirogov
 
CloudStack hands-on workshop @ DevOpsDays Amsterdam 2015
CloudStack hands-on workshop @ DevOpsDays Amsterdam 2015CloudStack hands-on workshop @ DevOpsDays Amsterdam 2015
CloudStack hands-on workshop @ DevOpsDays Amsterdam 2015
 
PFIセミナー資料 H27.10.22
PFIセミナー資料 H27.10.22PFIセミナー資料 H27.10.22
PFIセミナー資料 H27.10.22
 
Dev ops
Dev opsDev ops
Dev ops
 
Linux Crash Dump Capture and Analysis
Linux Crash Dump Capture and AnalysisLinux Crash Dump Capture and Analysis
Linux Crash Dump Capture and Analysis
 
How to Burn Multi-GPUs using CUDA stress test memo
How to Burn Multi-GPUs using CUDA stress test memoHow to Burn Multi-GPUs using CUDA stress test memo
How to Burn Multi-GPUs using CUDA stress test memo
 
Docker practice
Docker practiceDocker practice
Docker practice
 
NetBSD workshop
NetBSD workshopNetBSD workshop
NetBSD workshop
 
qemu + gdb: The efficient way to understand/debug Linux kernel code/data stru...
qemu + gdb: The efficient way to understand/debug Linux kernel code/data stru...qemu + gdb: The efficient way to understand/debug Linux kernel code/data stru...
qemu + gdb: The efficient way to understand/debug Linux kernel code/data stru...
 

More from While42

2 membres de while42 dans Programmez!
2 membres de while42 dans Programmez!2 membres de while42 dans Programmez!
2 membres de while42 dans Programmez!
While42
 
while42 Marseille #1
while42 Marseille #1while42 Marseille #1
while42 Marseille #1
While42
 
The Immigration reform
The Immigration reformThe Immigration reform
The Immigration reform
While42
 
42 (school) at 2 years of while42
42 (school) at 2 years of while4242 (school) at 2 years of while42
42 (school) at 2 years of while42
While42
 
La Silicon Valley vue par Camille Despringhere
La Silicon Valley vue par Camille DespringhereLa Silicon Valley vue par Camille Despringhere
La Silicon Valley vue par Camille Despringhere
While42
 
Singapore chapitre #4 - You don't know
Singapore chapitre #4 - You don't knowSingapore chapitre #4 - You don't know
Singapore chapitre #4 - You don't knowWhile42
 
Singapore chapitre #4 - Presentation
Singapore chapitre #4 - PresentationSingapore chapitre #4 - Presentation
Singapore chapitre #4 - Presentation
While42
 
while42 mentionné dans la version papier du quotidien "Le Monde"
while42 mentionné dans la version papier du quotidien "Le Monde"while42 mentionné dans la version papier du quotidien "Le Monde"
while42 mentionné dans la version papier du quotidien "Le Monde"
While42
 
Javascript sucks & frontend challenges @ClearSlide | while42 SF #7
Javascript sucks & frontend challenges @ClearSlide | while42 SF #7Javascript sucks & frontend challenges @ClearSlide | while42 SF #7
Javascript sucks & frontend challenges @ClearSlide | while42 SF #7
While42
 
While42 SF presentation | w42 #7 at ClearSlide
While42 SF presentation | w42 #7 at ClearSlideWhile42 SF presentation | w42 #7 at ClearSlide
While42 SF presentation | w42 #7 at ClearSlide
While42
 
while42 Montreal #0 @ wajam
while42 Montreal #0 @ wajamwhile42 Montreal #0 @ wajam
while42 Montreal #0 @ wajam
While42
 
Bugs from Outer Space | while42 SF #6
Bugs from Outer Space | while42 SF #6Bugs from Outer Space | while42 SF #6
Bugs from Outer Space | while42 SF #6
While42
 
While42 SF #6: introducing while42 to Girls in Tech and Kwarter
While42 SF #6: introducing while42 to Girls in Tech and KwarterWhile42 SF #6: introducing while42 to Girls in Tech and Kwarter
While42 SF #6: introducing while42 to Girls in Tech and Kwarter
While42
 
While42 Paris #1 - Presentation de while42
While42 Paris #1 - Presentation de while42While42 Paris #1 - Presentation de while42
While42 Paris #1 - Presentation de while42
While42
 
Hack le droid
Hack le droidHack le droid
Hack le droid
While42
 

More from While42 (15)

2 membres de while42 dans Programmez!
2 membres de while42 dans Programmez!2 membres de while42 dans Programmez!
2 membres de while42 dans Programmez!
 
while42 Marseille #1
while42 Marseille #1while42 Marseille #1
while42 Marseille #1
 
The Immigration reform
The Immigration reformThe Immigration reform
The Immigration reform
 
42 (school) at 2 years of while42
42 (school) at 2 years of while4242 (school) at 2 years of while42
42 (school) at 2 years of while42
 
La Silicon Valley vue par Camille Despringhere
La Silicon Valley vue par Camille DespringhereLa Silicon Valley vue par Camille Despringhere
La Silicon Valley vue par Camille Despringhere
 
Singapore chapitre #4 - You don't know
Singapore chapitre #4 - You don't knowSingapore chapitre #4 - You don't know
Singapore chapitre #4 - You don't know
 
Singapore chapitre #4 - Presentation
Singapore chapitre #4 - PresentationSingapore chapitre #4 - Presentation
Singapore chapitre #4 - Presentation
 
while42 mentionné dans la version papier du quotidien "Le Monde"
while42 mentionné dans la version papier du quotidien "Le Monde"while42 mentionné dans la version papier du quotidien "Le Monde"
while42 mentionné dans la version papier du quotidien "Le Monde"
 
Javascript sucks & frontend challenges @ClearSlide | while42 SF #7
Javascript sucks & frontend challenges @ClearSlide | while42 SF #7Javascript sucks & frontend challenges @ClearSlide | while42 SF #7
Javascript sucks & frontend challenges @ClearSlide | while42 SF #7
 
While42 SF presentation | w42 #7 at ClearSlide
While42 SF presentation | w42 #7 at ClearSlideWhile42 SF presentation | w42 #7 at ClearSlide
While42 SF presentation | w42 #7 at ClearSlide
 
while42 Montreal #0 @ wajam
while42 Montreal #0 @ wajamwhile42 Montreal #0 @ wajam
while42 Montreal #0 @ wajam
 
Bugs from Outer Space | while42 SF #6
Bugs from Outer Space | while42 SF #6Bugs from Outer Space | while42 SF #6
Bugs from Outer Space | while42 SF #6
 
While42 SF #6: introducing while42 to Girls in Tech and Kwarter
While42 SF #6: introducing while42 to Girls in Tech and KwarterWhile42 SF #6: introducing while42 to Girls in Tech and Kwarter
While42 SF #6: introducing while42 to Girls in Tech and Kwarter
 
While42 Paris #1 - Presentation de while42
While42 Paris #1 - Presentation de while42While42 Paris #1 - Presentation de while42
While42 Paris #1 - Presentation de while42
 
Hack le droid
Hack le droidHack le droid
Hack le droid
 

Recently uploaded

UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 

Recently uploaded (20)

UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 

Qemu - Raspberry | while42 Singapore #2

  • 2.
  • 3. QEMU is a hosted virtual machine monitor: It emulates central processing units through dynamic binary translation and provides a set of device models, enabling it to run a variety of unmodified guest operating systems.
  • 5. A chroot on Unix operating systems is an operation that changes the apparent root directory for the current running process and its children.
  • 7. The Raspberry Pi has a Broadcom BCM2835 system on a chip (SoC),[3] which includes an ARM1176JZF-S 700 MHz processor
  • 9. What about speed? pi@raspberrypi:~$ cat /proc/cpuinfo | grep MIPS BogoMIPS : 697.95 pi@raspberrypi:~$ cat /proc/cpuinfo | grep MIPS BogoMIPS Not good! : 565.24
  • 10. Qemu compilation ARM1176JZF-S # # # # git clone http://git.qemu.org/git/qemu.git ./configure --target-list="arm-softmmu arm-linux-user" --enable-sdl --static make sudo make install
  • 11. Preparation ● ● Download the latest version of Raspbian (link) Download the linux kernel for Qemu (link) # qemu-system -kernel kernel-qemu -cpu arm1176 -M versatilepb -no-reboot -append "root=/dev/sda2 panic=0 ro single" -hda XXXXX-raspbian.img # mount / -o remount,rw ● ● Edit fstab and change mmcblk0p1 and mmcblk0p2 to sda1 and sda2 respectively Create /etc/udev/rules.d/90-qemu.rules KERNEL=="sda", SYMLINK+="mmcblk0" KERNEL=="sda?", SYMLINK+="mmcblk0p%n", ● Comment everything in /etc/ld.so.preload
  • 12. Enlarge it! # cp XXXXX-raspbian.img raspbian.img # qemu-img resize raspbian.img +6G # qemu-system -kernel kernel-qemu -cpu arm1176 -M versatilepb -no-reboot -append "root=/dev/sda2 panic=1" -hda XXXXX-raspbian.img -hdb raspbian.img # sudo cfdisk /dev/sdb ●Delete the second partition and create a new partition with all space # sudo resize2fs /dev/sdb2 # sudo fsck -f /dev/sdb2 # sudo halt # qemu-system -kernel kernel-qemu -cpu arm1176 -M versatilepb -no-reboot -append "root=/dev/sda2 panic=1" -hda raspbian.img
  • 13. Chroot it # sudo kpartx -a -v 2012-12-16-wheezy-raspbian.img add map loop0p1 (252:8): 0 114688 linear /dev/loop0 8192 add map loop0p2 (252:9): 0 5763072 linear /dev/loop0 122880 # sudo mount /dev/mapper/loop0p2 /mnt/temp# sudo mount -o bind /dev /mnt/temp/dev # sudo mount -o bind /proc /mnt/temp/proc # sudo mount -o bind /sys /mnt/temp/sys Don’t forget to copy the qemu-arm binary to the image # sudo cp /usr/bin/qemu-arm /mnt/temp/usr/bin # cat /usr/share/binfmts/qemu-arm package qemu-user-static interpreter /usr/bin/qemu-arm-static credentials yes offset 0 magic x7fELFx01x01x01x00x00x00x00x00x00x00x00x00x02x00x28x00 mask xffxffxffxffxffxffxffx00xffxffxffxffxffxffxffxffxfexffxffxff Run sudo update-binfmts --import qemu-arm two times (yes, two times)
  • 14. And we are good to go Now, you should be able to chroot # sudo chroot /mnt/temp Let’s check if it’s working # uname -a Linux localhost 2.6.32 #58-Ubuntu SMP Thu Jan 24 15:28:10 UTC 2013 armv7l GNU/Linux