Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Ubuntuのriscv64版をqemuで動かした
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Kazuhiro NISHIYAMA
April 27, 2024
Programming
150
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Ubuntuのriscv64版をqemuで動かした
[LILO&東海道らぐオフラインミーティング 2024-04-27](
https://lilo.connpass.com/event/316818/)での発表資料です
。
Kazuhiro NISHIYAMA
April 27, 2024
More Decks by Kazuhiro NISHIYAMA
See All by Kazuhiro NISHIYAMA
Rubyの配布パッケージの変遷
znz
0
37
Headscale + Tailscale に移行中
znz
0
78
Ruby on Rails と私
znz
0
85
riscv64.rubyci.org internal
znz
0
64
Rubyの日本語リファレンスマニュアルの現在と未来
znz
0
120
devise-two-factorを4.xから5.xに上げた話
znz
0
440
docs.ruby-lang.org/ja/ の生成方法を変えた
znz
0
120
lilo.linux.or.jpをbusterからbullseyeに上げた
znz
0
150
小規模個人アプリをRails 7.xにバージョンアップした話
znz
0
140
Other Decks in Programming
See All in Programming
生成AIで帳票OCRが「簡単に」作れる時代になった?
kon_shou
0
670
仕様駆動開発へのトライを機に チームに適合する手法を模索し続けている話
freee
PRO
0
460
Terraform標準の組織で AWS CDKをどう使うか
mu7889yoon
1
500
いまどきの Codex で開発する visionOS アプリの開発スタイルについて
karad
0
110
「人を評価する AI」の設計と実装
ryoyanara
0
180
Japan Community Day at Kubecon + CloudNativeCon Japan 2026: Learning Container Privilege Control by Building My Own Low-Level Container Runtime
ternbusty
1
150
SlackアプリとLambdaの 連携を構築した話
pawn_4_s
1
110
GDG Korea Android: 2026 I/O Extended ~ What's new in Android development tools
pluu
0
220
Google Apps Script で Ruby を動かす
kawahara
0
140
TSX の <Hoge<Fuga>> という構文に驚いた話 / tsx-type-argument-syntax
kanaru0928
0
210
『コードを書く以外の』エンジニアリング〜課金基盤移行プロジェクト推進のためのTips4選
yuriko1211
0
590
PHP に部分適用が来るぞ!……ところで何それ?おいしいの? #phpcon / phpcon-2026
shogogg
0
610
Featured
See All Featured
It's Worth the Effort
3n
188
29k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
210
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.7k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
280
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
610
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
450
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
380
Mind Mapping
helmedeiros
PRO
1
300
Transcript
Ubuntuのriscv64版をqemu で動かした Kazuhiro NISHIYAMA LILO&東海道らぐオフラインミーティング 2024-04-27 2024-04-27 Powered by Rabbit
3.0.3
self.introduction 西山 和広 Ruby のコミッター github など: @znz 株式会社Ruby開発 www.ruby-dev.jp
1/10
ホスト Debian GNU/Linux 12 (bookworm) qemu-system* 1:7.2+dfsg-7+deb12u5 libvirt-daemon 9.0.0-4 u-boot-qemu
2023.01+dfsg-2 cloud-image-utils 0.33-1 2/10
ゲストイメージファイル https://cloud-images.ubuntu.com から ダウン ロード /${codename}/current/${codename}-server- cloudimg-${arch}.img でデイリービルド版 https://cloud-images.ubuntu.com/releases/ に
リリース版 基本デイリービルドでたまたま問題があるビルド だったらリリース版を選ぶぐらいでいいかも (実機用は https://cdimage.ubuntu.com/ releases/) 3/10
イメージをいい感じにする img=noble-server-cloudimg-riscv64.img wget https://cloud-images.ubuntu.com/noble/current/$img qemu-img resize "$img" +5G qcow2 形式
速度のため raw に変換するのもあり (qemu-img convert -f qcow2 -O raw "$orig" "$img") ギリギリのディスクサイズなのでリサイズ ちょっと試すなら +5G ぐらい もっと使うなら 16G とかに増やす (qemu-img resize "$img" 16G) 4/10
最低限の起動確認 qemu-system-riscv64 -nographic -M virt -m 1G \ -kernel /usr/lib/u-boot/qemu-riscv64_smode/uboot.elf
\ -drive "if=virtio,format=qcow2,file=$img" -snapshot -machine (-M) は virt で良さそう -m は適当に増やす デフォルトの 128 だと起動しなかった -kernel は uboot で起動 -bios に opensbi の fw_jump.elf の指定は不要 -snapshot で書き込みは止めておいた 5/10
ログイン準備 mkdir config echo "instance-id: $(uuidgen || echo i-abcdefg)" >
config/meta-data vi config/user-data cloud-localds "seed.iso" config/user-data config/meta-data 起動できるが root もパスワードがなくてログ インできない cloud-init で設定するため ISO ファイル作成 -drive "if=virtio,format=raw,file=seed.iso" を追 加して起動 6/10
config/user-data 詳細は cloud-init のドキュメントを参照 例: https://cloudinit.readthedocs.io/en/latest/ reference/examples.html #cloud-config hostname: noble-riscv64
# user: ubuntu のパスワード設定 password: ubuntu chpasswd: { expire: False } ssh_pwauth: true # 各種設定 timezone: Asia/Tokyo locale: ja_JP.utf8 # 自分のssh鍵を設定 ssh_import_id: - gh:znz 7/10
起動 qemu-system-riscv64 -nographic -M virt -m 2G -smp 4 \
-kernel /usr/lib/u-boot/qemu-riscv64_smode/uboot.elf \ -drive "if=virtio,format=qcow2,file=$img" \ -drive "if=virtio,format=raw,file=seed.iso" \ -device "virtio-net-device,netdev=net0" \ -netdev "user,id=net0,hostfwd=tcp::2222-:22" \ -device virtio-rng-pci \ -snapshot メモリや CPU も増やした ネット接続や RNG デバイスも追加 「ssh -o "StrictHostKeyChecking no" -p 2222 ubuntu@localhost」でログイン可能 8/10
その他の設定 今日はここまで 後日、ブログ https://blog.n-z.jp/ に記事を書く 予定 qemu-guest-agent 対応 https://wiki.qemu.org/Documentation/9psetup でホ
ストとのファイル共有 自動起動のため libvirt 管理下に移行 9/10
まとめ cloud-images.ubuntu.com にある amd64, arm64, armhf, ppc64el, riscv64, s390x はどれ
も同じように使える(はず) 最低限の起動までは arch ごとに調査が必要 cloud-init でログインできる設定が必要 他の設定はできるだけシェルスクリプトや ansible などの provisioner を使う方が楽かも cloud-init は試行錯誤しにくい ansible などは知識の流用がしやすい 10/10 Powered by Rabbit 3.0.3