To content | To menu | To search

Tuesday, March 12 2024

Xubuntu にログインできなかった件

パソコンは Panasonic CF-RZ4 。OS は Xubuntu 23.10 x86_64 。

Continue reading...

Saturday, January 27 2024

Ubuntu のデスクトップを BeOS 風にする(途中まで・Raspberry Pi も追記)

まずはウィンドウとその他デザインまで。

先人に感謝。

Raspberry Pi の場合はあらかじめ こちら を実行。

Continue reading...

Saturday, October 1 2022

Pogoplug に Debian GNU/Linux をインストールする

技研ベースさんで開催された「技研フリマ」で購入した、ジャンク扱いの Pogoplug に Debian GNU/Linux をインストールした。とりあえず USB メモリからの起動まで。

個体は Pogoplug POGO-P25 。こちら で紹介されているものと恐らく同じ。

ジャンク扱いで買ったのでアカウントは無し。

Continue reading...

Tuesday, February 8 2022

Windows 上の HashiCorp Packer で Ubuntu Server と Preseed

動いた。Ubuntu(というか Xubuntu)Desktop では動かせていないものの、Ubuntu Server では素直に動いた。

ubuntuserver18.04.1.pkr.hcl

variable "build_directory" {
    default = "./build"
}

variable "boot_wait" {
    default = "10s"
}

variable "cpus" {
    default = 1
}

variable "disk_size" {
    default = 50000
}

variable "headless" {
    default = false
}

variable "http_directory" {
    default = "./http"
}

variable "iso_url" {
    type = string
}

variable "iso_checksum" {
    type = string
}

variable "memory" {
    default = 1024
}

variable "username" {
    default = "vagrant"
}

variable "vm_name" {
    type = string
}

variable "provider_name" {
    default = "virtualbox"
}

variable "ssh_timeout" {
    default = "45m"
}

source "virtualbox-iso" "ubuntuserver18041" {

    boot_command = [
        "<enter><wait>",
        "<esc><wait>",
        "<enter><wait>",
        "/install/vmlinuz<wait>",
        " file=/cdrom/preseed/ubuntu-server.seed vga=788 initrd=/install/initrd.gz",
        " auto-install/enable=true",
        " debconf/priority=critical",
        " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ubuntuserver18.04.1.cfg",
        " --- <wait>",
        "<enter><wait>"
    ]

    boot_wait            = var.boot_wait
    cpus                 = var.cpus
    disk_size            = var.disk_size
    guest_os_type        = "Ubuntu_64"
    hard_drive_interface = "sata"
    headless             = var.headless
    http_directory       = var.http_directory
    iso_url              = var.iso_url
    iso_checksum         = var.iso_checksum
    memory               = var.memory
    output_directory     = "${var.build_directory}/packer-${var.provider_name}"
    shutdown_command     = "echo '${var.username}' | sudo -S shutdown -P now"
    ssh_timeout          = var.ssh_timeout
    ssh_username         = var.username
    ssh_password         = var.username
    vm_name              = var.vm_name
}

build {
    sources = ["sources.virtualbox-iso.ubuntuserver18041"]
}

ubuntuserver18.04.1.pkrvars.hcl

iso_url="file://f:/iso/ubuntu-18.04.1-server-amd64.iso"
iso_checksum="md5:e8264fa4c417216f4304079bd94f895e"
vm_name="UbuntuServer18.04.1"
username="vagrant"

ubuntuserver18.04.1.cfg (仮)

d-i debian-installer/locale string en_US
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/xkb-keymap select us
d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain
d-i netcfg/wireless_wep string
d-i mirror/country string manual
d-i mirror/http/hostname string archive.ubuntu.com
d-i mirror/http/directory string /ubuntu
d-i mirror/http/proxy string
d-i passwd/user-fullname string vagrant
d-i passwd/username string vagrant
d-i passwd/user-password password vagrant
d-i passwd/user-password-again password vagrant
d-i passwd/user-uid string 1000
d-i user-setup/allow-password-weak boolean true
d-i user-setup/encrypt-home boolean false
d-i clock-setup/utc boolean true
d-i time/zone string US/Eastern
d-i partman-auto/method string lvm
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-auto/choose_recipe select atomic
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman-md/confirm boolean true
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
tasksel tasksel/first standard
d-i pkgsel/include string openssh-server build-essential
d-i pkgsel/update-policy select none
d-i pkgsel/install-language-support boolean false
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
d-i finish-install/reboot_in_progress note

cfg ファイルを http フォルダにおいて、

packer build --force -var-file=ubuntuserver18.04.1.pkrvars.hcl ubuntuserver18.04.1.pkr.hcl

で動いてくれた。内容とか適当で、言語とキーボードの選択がまだ残ってたのでいろいろと調整が必要。

インストールが終わると build フォルダに vmware 用のが出力されたので、この辺ももう少し調査がいるか。

Monday, February 7 2022

メモ。Packer で起動した Ubuntu で Pressed が動かない

そもそも Ubuntu (というか Xubuntu) Desktop で Pressed が動くのかどうかよくわからない。検索すると、デスクトップ環境が欲しいなら Ubuntu Server インストール後に Desktop のパッケージを入れれば良い、という情報もある。

Pressed のファイルは、live OS 上のブラウザからもアクセスできるし、起動ログにもロードしたらしい情報があるのに動いてくれないので、次は Ubuntu Server で試してみるしかなさそう。

この辺でうごいてくれたら、Packer 関係無く Ubuntu の話だ。

試した Packer ファイルはこちら

variable "build_directory" {
    default = "./build"
}

variable "boot_wait" {
    default = "5s"
}

variable "cpus" {
    default = 1
}

variable "disk_size" {
    default = 50000
}

variable "headless" {
    default = false
}

variable "http_directory" {
    default = "./http"
}

variable "iso_url" {
    type = string
}

variable "iso_checksum" {
    type = string
}

variable "memory" {
    default = 1024
}

variable "username" {
    default = "vagrant"
}

variable "vm_name" {
    type = string
}

variable "provider_name" {
    default = "virtualbox"
}

variable "ssh_timeout" {
    default = "45m"
}

source "virtualbox-iso" "ubuntu20041" {

    boot_command = [
        "<esc><wait>",
        "<esc><wait>",
        "<esc><wait>",
        "<enter><wait>",
        "/casper/vmlinuz<wait>",
        " file=/cdrom/preseed/xubuntu.seed boot=casper initrd=/casper/initrd",
        " noninteractive",
        " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed_2.cfg",
        " -- <wait>",
        "<enter><wait>"
    ]

    boot_wait            = var.boot_wait
    cpus                 = var.cpus
    disk_size            = var.disk_size
    guest_os_type        = "Ubuntu_64"
    hard_drive_interface = "sata"
    headless             = var.headless
    http_directory       = var.http_directory
    iso_url              = var.iso_url
    iso_checksum         = var.iso_checksum
    memory               = var.memory
    output_directory     = "${var.build_directory}/packer-${var.provider_name}"
    shutdown_command     = "echo '${var.username}' | sudo -S shutdown -P now"
    ssh_timeout          = var.ssh_timeout
    ssh_username         = var.username
    ssh_password         = var.username
    vm_name              = var.vm_name
}

build {
    sources = ["sources.virtualbox-iso.ubuntu20041"]
}

boot_command に対しては、いろいろ書いてみたけどわからない(全部一気に書いたわけではない)。

        " auto-install/enable=true",
        " debconf/priority=critical",
        " ksdevice=enp0s3 interface=enp0s3",
        " debug-ubiquity automatic-ubiquity only-ubiquity noninteractive",

そもそも起動するまでも紆余曲折だった。

boot_wait を 10s に設定していたら、boot_command が始まるのが間に合わなかったので 5s に短縮。これは実機合わせが必要だと思う。

boot_command の最初の

        "<esc><wait>",
        "<esc><wait>",
        "<esc><wait>",
        "<enter><wait>",

これも実際に動かして確認。

        "/casper/vmlinuz<wait>",
        " file=/cdrom/preseed/xubuntu.seed boot=casper initrd=/casper/initrd",

ここはしばらくかかった。ISO で起動したときの boot オプションを参照しなければいけない。けど Ubuntu18 のインストーラは vmlinuz 書いてないからわからなかった。古いやつなら /install/vmlinuz でいいはず。実際に ISO をマウントして確認したパスを設定。なので、ここも実際の ISO を確認しながら作っていかなければいけない。

Friday, January 14 2022

Ubuntu のインストールメディアの起動で「(initramfs) Unable to find a medium containing a live file system」となってインストールできない

環境は、

  • Ubuntu 18.04.1 (ubuntu-18.04.1-desktop-amd64.iso)
  • EPSON MR8300-M (Core i3-10100、512GB SATA SSD、メーカーオプションのDVD-ROM ドライブ内蔵)

元々内蔵されていた SSD は取り外し、新しく SATA SSD を接続して Ubuntu のメディアを起動したら、

(initramfs) Unable to find a medium containing a live file system

と表示されてどうにもできなくなってしまった。

Secure Boot 有効のままで、結局別に USB 接続の DVD-ROM ドライブ(今回は Lenovo 0A33988?0A34254)で起動したら問題無くセットアップできた。