LoginSignup
0
0

Ubuntu Server 24.04 LTSをKVMで動かしてみた

Posted at

はじめに

Ubuntu Server 20.04.6 LTSのKVMで、Ubuntu Server 24.04 LTSを動かしたときのメモです。

参考にしたサイト

環境

ホストOS

  • Ubuntu Server 20.04.6 LTS

ゲストOS

  • Ubuntu Server 24.04 LTS

ディレクトリ構成

/home/user
 |
 +-- dvd
 |    |
 |    +-- ubuntu-24.04-live-server-amd64.iso
 |
 +-- kvm
      |
      +-- ubuntu24-51
           |
           +-- install.sh
           |
           +-- ubuntu24-51.qcow2
  • 上記ディレクトリ構成はサンプルです。適宜変更してください。
  • 筆者のディレクトリの命名規則として、ubuntu24-51の末尾の51は、IPアドレスの最終オクテットを表しています。左記の場合、この仮想マシンには、192.168.122.51を割り当てています。

手順

  1. 以下からUbuntuのインストーラーをダウンロードしてください。
  2. 仮想ディスクを作成してください。
    qemu-img create -f qcow2 ubuntu24-51.qcow2 128G
    
  3. install.shファイルを作成してください。
    touch install.sh
    
    chmod +x install.sh
    
  4. vimなどでinstall.shを開き、以下のように編集してください。
    virt-install \
    --name ubuntu24-51 \
    --hvm \
    --virt-type kvm \
    --ram 8192 \
    --vcpus 4 \
    --arch x86_64 \
    --os-type linux \
    --disk /home/user/kvm/ubuntu24-51/ubuntu24-51.qcow2 \
    --network bridge=virbr0 \
    --graphics none \
    --serial pty \
    --console pty \
    --location /home/user/linux/dvd/ubuntu-24.04-live-server-amd64.iso,kernel=casper/vmlinuz,initrd=ca   sper/initrd \
    --extra-args "console=ttyS0"
    
    • GUIを入れていない環境なので、--graphics noneを指定しています。
  5. install.shを実行すると、インストーラーが起動します。
    ./install.sh
    

さいごに

Ubuntu Server 24.04もUbuntu Server 22.04と同じ手順でインストールできました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0