ユーザ用ツール

サイト用ツール


サイドバー

最新の10件
一覧
linux:virtualmachine:quickemu

quickemu

Linuxでqemuの各種イメージを作成したり実行したりできる.macOSに対応しているのが珍しい.(macOSはApple以外の機械で動かすとライセンス違反だと思う.)

対応osはどんどん増えている

$ ./quickget                                                            
ERROR! You must specify an operating system:
elementary freebsd fedora kali kubuntu linuxmint-cinnamon linuxmint-mate linuxmint-xfce nixos-gnome nixos-plasma5 nixos-minimal lubuntu macos openbsd opensuse popos ubuntu ubuntu-budgie ubuntu-kylin ubuntu-mate ubuntu-studio windows xubuntu
$ ./quickemu --help

Usage
  quickemu --vm ubuntu.conf

You can also pass optional parameters
  --delete                : Delete the disk image.
  --display               : Select display backend. 'sdl' (default), 'gtk', 'none', or 'spice'
  --fullscreen            : Starts VM in full screen mode (Ctl+Alt+f to exit)
  --ignore-msrs-always    : Configure KVM to always ignore unhandled machine-specific registers
  --screen <screen>       : Use specified screen to determine the window size.
  --shortcut              : Create a desktop shortcut
  --snapshot apply <tag>  : Apply/restore a snapshot.
  --snapshot create <tag> : Create a snapshot.
  --snapshot delete <tag> : Delete a snapshot.
  --snapshot info         : Show disk/snapshot info.
  --status-quo            : Do not commit any changes to disk/snapshot.
  --version               : Print version
$ ./macrecovery --help
usage: macrecovery [-h] [-o OUTDIR] [-n BASENAME] [-b BOARD_ID] [-m MLB] [-e CODE] [-os {default,latest}] [-diag] [-v] [-db BOARD_DB] {download,selfcheck,verify,guess}

Gather recovery information for Macs

positional arguments:
  {download,selfcheck,verify,guess}
                        Action to perform: "download" - performs recovery downloading, "selfcheck" checks whether MLB serial validation is possible, "verify" performs MLB serial verification,
                        "guess" tries to find suitable mac model for MLB.

optional arguments:
  -h, --help            show this help message and exit
  -o OUTDIR, --outdir OUTDIR
                        customise output directory for downloading, defaults to current directory
  -n BASENAME, --basename BASENAME
                        customise base name for downloading, defaults to remote name
  -b BOARD_ID, --board-id BOARD_ID
                        use specified board identifier for downloading, defaults to Mac-7BA5B2D9E42DDD94
  -m MLB, --mlb MLB     use specified logic board serial for downloading, defaults to 00000000000000000
  -e CODE, --code CODE  generate product logic board serial with specified product EEEE code
  -os {default,latest}, --os-type {default,latest}
                        use specified os type, defaults to default 00000000000000000
  -diag, --diagnostics  download diagnostics image
  -v, --verbose         print debug information
  -db BOARD_DB, --board-db BOARD_DB
                        use custom board list for checking, defaults to boards.json

FreeBSD

$ ./quickget freebsd 13.0
freebsd-13.0/FreeBSD-13.0-RELEASE-amd64-dvd1.iso  100%[============================================================================================================>]   4.46G   998KB/s    in 1h 59m  
Checking freebsd-13.0/FreeBSD-13.0-RELEASE-amd64-dvd1.iso with sha512sum... Good!
Making VM configuration for freebsd-13.0...

To start your freebsd 13.0 virtual machine run:
    quickemu --vm freebsd-13.0.conf

$ du -hs ./freebsd-13.0
4.5G    ./freebsd-13.0
$ quickemu --vm freebsd-13.0.conf
Quickemu 2.2.8 using /usr/bin/qemu-system-x86_64 v6.1.0
 - Host:     Debian GNU/Linux bookworm/sid running Linux 5.14 (t430s)
 - CPU:      Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz
 - CPU VM:   1 Socket(s), 1 Core(s), 2 Thread(s), 4G RAM
 - BOOT:     EFI (Freebsd), OVMF (/usr/share/OVMF/OVMF_CODE_4M.fd), SecureBoot (off).
 - Disk:     freebsd-13.0/disk.qcow2 (16G)
             Just created, booting from freebsd-13.0/FreeBSD-13.0-RELEASE-amd64-dvd1.iso
 - Boot ISO: freebsd-13.0/FreeBSD-13.0-RELEASE-amd64-dvd1.iso
 - Display:  SDL, qxl-vga, GL (on), VirGL (off)
 - ssh:      On host:  ssh user@localhost -p 22220
 - SPICE:    On host:  spicy --title "freebsd-13.0" --port 5930 --spice-shared-dir /home/matoken/Public
 - WebDAV:   On guest: dav://localhost:9843/
 - 9P:       On guest:  - smbd:     On guest: smb://10.0.2.4/qemu
qxl_send_events: spice-server bug: guest stopped, ignoring
 - Process:  Starting freebsd-13.0.conf as freebsd-13.0 (3913575)

macOS

$ ./quickget macos                                                     
ERROR! You must specify a release: high-sierra mojave catalina big-sur monterey
$ ./quickget macos monterey                                                                                                                                                
macos-monterey/OpenCore.qcow2                     100%[============================================================================================================>]  15.50M   956KB/s    in 18s     
macos-monterey/OVMF_CODE.fd                       100%[============================================================================================================>]   1.88M   856KB/s    in 2.2s    
macos-monterey/OVMF_VARS-1024x768.fd              100%[============================================================================================================>] 128.00K   325KB/s    in 0.4s    
Downloading monterey...                  
Downloading 694-36979...                                                                           
Saving http://oscdn.apple.com/content/downloads/35/50/071-78669/48tvu2ovyeozcixrzzcoxsja3gs4yedmxc/RecoveryImage/BaseSystem.dmg to RecoveryImage.dmg...
Download complete!Bs downloaded...
Saving http://oscdn.apple.com/content/downloads/35/50/071-78669/48tvu2ovyeozcixrzzcoxsja3gs4yedmxc/RecoveryImage/BaseSystem.chunklist to RecoveryImage.chunklist...
Download complete!75 MBs downloaded...
Verifying image with chunklist...
Image verification complete!                     
Converting RecoveryImage...                                                                        
qemu: module block-block-dmg-bz2 not found, do you want to install qemu-block-extra package?
qemu: module block-block-dmg-lzfse not found, do you want to install qemu-block-extra package?
Making VM configuration for macos-monterey...                                                      
                                                                                                   
To start your macos monterey virtual machine run: 
    quickemu --vm macos-monterey.conf                                                              
                                                                   
$ du -sh ./macos-monterey
2.2G    ./macos-monterey
$ quickemu --vm macos-monterey.conf
Quickemu 2.2.8 using /usr/bin/qemu-system-x86_64 v6.1.0 
 - Host:     Debian GNU/Linux bookworm/sid running Linux 5.14 (t430s)
 - CPU:      Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz
 - CPU VM:   1 Socket(s), 1 Core(s), 2 Thread(s), 4G RAM
 - BOOT:     EFI (macOS), OVMF (OVMF_CODE.fd), SecureBoot (off).
ERROR! macOS requires a CPU with SSE 4.1 and AVX2 support.

Windows 11

$ du -sh ./windows-11
5.7G    ./windows-11
$ quickemu --vm ./windows-11.conf
ERROR! TPM is enabled, but swtpm was not found.      

SWTPM(Software TPM Emulator) を導入

$ git clone https://github.com/stefanberger/swtpm
$ cd swtpm
$ ./autogen.sh --prefix=/usr
$ make
$ make check
$ make install
$ quickemu --vm ./windows-11.conf 
Quickemu 2.2.8 using /usr/bin/qemu-system-x86_64 v6.1.0
 - Host:     Debian GNU/Linux bookworm/sid running Linux 5.14 (t430s)
 - CPU:      Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz
 - CPU VM:   1 Socket(s), 1 Core(s), 2 Thread(s), 4G RAM
 - BOOT:     EFI (Windows), OVMF (/usr/share/OVMF/OVMF_CODE_4M.fd), SecureBoot (off).
 - Disk:     windows-11/disk.qcow2 (64G)
             Looks unused, booting from windows-11/Win11_EnglishInternational_x64.iso
 - MSR:      WARNING! Ignoring unhandled Model-Specific Registers is disabled.

             echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs

             If you are unable to run macOS or Windows VMs then run the above 👆
             This will enable ignoring of unhandled MSRs until you reboot the host.
             You can make this change permenant by running: 'quickemu --ignore-msrs-always'
 - Boot ISO: windows-11/Win11_EnglishInternational_x64.iso
 - CD-ROM:   windows-11/virtio-win.iso
 - Display:  SDL, qxl-vga, GL (on), VirGL (off)
 - ssh:      On host:  ssh user@localhost -p 22220
 - SPICE:    On host:  spicy --title "windows-11" --port 5930 --spice-shared-dir /home/matoken/Public
 - WebDAV:   On guest: dav://localhost:9843/
 - smbd:     On guest: smb://10.0.2.4/qemu
 - TPM:      windows-11/windows-11.swtpm-sock (4136367)
qxl_send_events: spice-server bug: guest stopped, ignoring
 - Process:  Starting ./windows-11.conf as windows-11 (4136369)

Ubuntu 21.10

$ ./quickget ubuntu impish
ubuntu-impish/ubuntu-21.10-desktop-amd64.iso      100%[============================================================================================================>]   2.90G  1.06MB/s    in 54m 33s 
WARNING! Can't guess hash algorithm, not checking ubuntu-impish/ubuntu-21.10-desktop-amd64.iso hash.
Making VM configuration for ubuntu-impish...

To start your ubuntu impish virtual machine run:
    quickemu --vm ubuntu-impish.conf

$ du -hs ./ubuntu-impish
3.0G    ./ubuntu-impish
$ quickemu --vm ubuntu-impish.conf
Quickemu 2.2.8 using /usr/bin/qemu-system-x86_64 v6.1.0
 - Host:     Debian GNU/Linux bookworm/sid running Linux 5.14 (t430s)
 - CPU:      Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz
 - CPU VM:   1 Socket(s), 1 Core(s), 2 Thread(s), 4G RAM
 - BOOT:     EFI (Linux), OVMF (/usr/share/OVMF/OVMF_CODE_4M.fd), SecureBoot (off).
 - Disk:     ubuntu-impish/disk.qcow2 (16G)
             Just created, booting from ubuntu-impish/ubuntu-21.10-desktop-amd64.iso
 - Boot ISO: ubuntu-impish/ubuntu-21.10-desktop-amd64.iso
 - Display:  SDL, virtio-vga, GL (on), VirGL (on)
 - ssh:      On host:  ssh user@localhost -p 22220
 - SPICE:    On host:  spicy --title "ubuntu-impish" --port 5930 --spice-shared-dir /home/matoken/Public
 - WebDAV:   On guest: dav://localhost:9843/
 - 9P:       On guest: sudo mount -t 9p -o trans=virtio,version=9p2000.L,msize=104857600 Public-matoken ~/Public
 - smbd:     On guest: smb://10.0.2.4/qemu
 - Process:  Starting ubuntu-impish.conf as ubuntu-impish (595806)

url

コメント

コメントを入力. Wiki文法が有効です:
  ____   _____   ___    ____  _      __
 / __ \ / ___/  / _ \  / __/ | | /| / /
/ /_/ // (_ /  / // / _\ \   | |/ |/ / 
\____/ \___/  /____/ /___/   |__/|__/
 
linux/virtualmachine/quickemu.txt · 最終更新: 2021/11/24 22:40 by matoken