2021年9月28日火曜日

Install Fedora Workstation 33 to Ras Pi4

 


https://linuxhint.com/install_fedora_33_raspberry_pi4/  から。

保管のために。著者名にリンク埋め込みあり

Raspberry Pi

How to Install Fedora 33 on Raspberry Pi 4

At the time of this writing, Fedora has official support for ARM devices like the Raspberry Pi 4. So, you can easily install Fedora 33 – the latest release of Fedora Linux distribution on your Raspberry Pi 4.

In this article, I am going to show you how to install Fedora Workstation 33 on the Raspberry Pi 4. So, let’s get started.

Things You Will Need:

To follow this article, you will need the following things:

  1. A Raspberry Pi 4 single-board computer.
  2. A USB Type-C power adapter.
  3. A 32 GB or higher capacity microSD card.
  4. A keyboard.
  5. A mouse.
  6. A monitor.
  7. A laptop or a desktop computer for downloading and flashing the Fedora 33 image on the microSD card.

Downloading Fedora 33 ARM Image:

To download the Fedora 33 ARM image, visit the official website of Fedora from your favourite web browser.

Once the page loads, click on Download Now from the Fedora Workstation section as marked in the screenshot below.


Click on the Download button from the Fedora 33 ARM section as marked in the screenshot below.


Your browser should prompt you to save the Fedora Workstation 33 ARM image file. Select a directory where you want to save the image file and click on Save.

Fedora Workstation 33 ARM image is being downloaded. It will take a while to complete.

Flashing Fedora 33 ARM Image on the MicroSD Card:

To flash the Fedora Workstation 33 ARM image on the microSD card, you can use many programs like Balena Etcher, Raspberry Pi Imager, Fedora Media Writer, and so on. In this article, I am going to use the Raspberry Pi Imager for the demonstration. Feel free to use any tool you like for this purpose.

If you need any assistance on installing the Raspberry Pi Imager, check my article How to Install and Use Raspberry Pi Imager.

First, insert the microSD card into your computer.


Start the Raspberry Pi Imager app and click on CHOOSE OS.


Scroll down a little bit and click on Use custom.


A file picker should be opened. Select the Fedora Workstation 33 ARM image that you just downloaded and click on Open.


Once the operating system image is selected, click on CHOOSE SD CARD.


Click on your microSD card from the list.


Once the MicroSD card is selected, click on WRITE.


All the existing data on your microSD card will be erased. To confirm the action, click on YES.


The Fedora Workstation 33 ARM image is being written to the microSD card. It may take a while to complete.


Once the Fedora Workstation 33 ARM image is flashed on to the microSD card,  you should see the following Write Successful window. Click on CONTINUE, close Raspberry Pi Imager, and remove the microSD card from your computer.

Booting Fedora 33 on Raspberry Pi 4:

  1. Insert the microSD card on your Raspberry Pi 4.
  2. Then, insert the micro HDMI cable of your monitor to the micro HDMI port of the Raspberry Pi 4.
  3. Also, Insert the keyboard and mouse to the USB 2.0 port of your Raspberry Pi 4.
  4. Optionally, you can plug in the network cable to the RJ45 Ethernet port of your Raspberry Pi 4.
  5. Finally, insert the USB Type-C power cable on the Raspberry Pi 4 and power it on.


Fedora Workstation 33 is being booted.


You have to configure Fedora Workstation 33 when it boots for the first time.


To start the configuration wizard, click on Start Setup, as shown in the image below.


You can configure the Wi-Fi network from here. I will use a wired Ethernet network. So, I will click on Skip.

NOTE: I could not connect to the Wi-Fi network. Maybe there are some bugs in the graphical user interface of Fedora Workstation 33. In a later update, the bugs may be fixed. As of now, you should be able to connect to your Wi-Fi network using the Network Manager’s command-line tools. But, I recommend using an Ethernet cable for network connectivity if you don’t strictly need Wi-Fi.


Click on Next.


Type in your Full Name and login Username. Once you’re done, click on Next.


Type in a login password and click on Next.


Click on Start Using Fedora.


Fedora Workstation 33 should be ready to use.


As you can see, I am using Fedora 33, and it’s using the Linux kernel 5.8.15.

$ cat /etc/redhat-release

$ uname -r


Fedora Workstation 33 uses about 1.2 GB of memory when no extra programs are running.

Removing Black Edges from the Monitor Display:

Fedora Workstation 33 may show black borders around your screen. It is because of overscan. In some monitors, overscan leaves exclusion zones around your monitor.

By default, overscan is enabled on Fedora Workstation 33. To fix this problem, all you have to do is disable overscan.


You should find a config.txt file in the /boot/efi/ directory, as you can see in the screenshot below.


To disable overscan, open the /boot/efi/config.txt file with the nano text editor as follows:

$ sudo nano /boot/efi/config.txt


The /boot/efi/config.txt file should be opened.


Scroll down to the end of the config.txt file and type in disable_overscan=1, as shown in the screenshot below.

Once you’re done, press <Ctrl> + X followed by Y and <Enter> to save the config.txt file.


For the changes to take effect, reboot your Raspberry Pi 4 with the following command:

$ sudo reboot


Once your Raspberry Pi 4 boots, the black borders should be gone.

Expanding the BTRFS Filesystem:

The default filesystem of Fedora Workstation 33 is BTRFS.

By default, only a portion of the microSD card is used for storing the operating system files and user data. The rest of the disk space is kept unallocated.

As you can see in the screenshot below, only 9.5 GB of disk space (out of 32 GB) from my microSD card is used for the root (/) filesystem.

$ df -h


To expand the file system, you have to expand the partition first.

To do that, open the microSD card with the fdisk command-line partitioning tool as follows:

$ sudo fdisk /dev/mmcblk1


fdisk should open the microSD card.

To list all the existing partitions of the microSD card, press p and then press <Enter>.


As you can see, the 9.4 GB partition is the 3rd partition of the microSD card. You have to remove the 3rd partition and re-create it. Don’t worry. You won’t lose any data.

To delete a partition, press d and press <Enter>.


Type in 3 as the partition number and press <Enter>.


The 3rd partition should be removed.

To re-create the 3rd partition, press n and then press <Enter>.


Press p and then press <Enter>.


Type in 3 as the partition number and press <Enter>.


Press <Enter> to select the default first sector number.


Press <Enter> to select the default last sector number.

The default last sector number should be the last allocable sector number (from the unallocated space of the microSD card) of the microSD card.


Press n and then press <Enter> to keep the existing partition signature.

NOTE: Be extra careful in this step. If you remove the existing partition signature, you won’t be able to recover your existing files very easily.


The 3rd partition should be recreated.

To save the changes, press w and then press <Enter>.


The updated partition table should be written to the microSD card, and the fdisk should be closed.


To resize the BTRFS root (/) filesystem to the max available space of the partition, run the following command:

$ sudo btrfs filesystem resize max /


The BTRFS root (/) filesystem should be resized.


As you can see, the root (/) filesystem is resized to 28 GB (from 9.4 GB).

Conclusion:

In this article, I have shown you how to install Fedora Workstation 33 on Raspberry Pi 4. I have also shown you how to remove the black edges from the monitor and expand the BTRFS root filesystem. This article should help you get started with Fedora Workstation 33 on the Raspberry Pi 4.

2021年8月25日水曜日


参照:https://biomodeling.co.jp/2020/04/30/ubuntu18%E3%81%AB%E3%83%AA%E3%83%A2%E3%83%BC%E3%83%88%E3%83%87%E3%82%B9%E3%82%AF%E3%83%88%E3%83%83%E3%83%97%E6%8E%A5%E7%B6%9A%E3%81%99%E3%82%8B%E6%89%8B%E9%A0%86/


Ubuntu18.04LTSのクラウドサーバーに、リモートデスクトップ接続する手順の紹介。
今回は、AWSで借りたクラウドサーバーにGNOMEとtigervncをインストールした。
(2020/4/30現在)

以下は、インスタンス 起動後、sshでログイン後からの手順。
使用したAmazon マシンイメージ:Deep Learning AMI (Ubuntu 18.04) Version 28.0

sudo apt update
sudo apt upgrade
sudo reboot

今回は、upgrade時に次のエラーが発生。

E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?

次のコマンドで、解決した。参考URL

(注: 上記エラーが出た時のみ、次のコマンドを実行する。)
sudo dpkg --configure -a

 
 

reboot後、少し待って再ログインし、次のコマンドで、GNOMEとtigervncをインストールする。

sudo apt install ubuntu-gnome-desktop
sudo apt install tigervnc-standalone-server

次のコマンドでパスワード設定のためにディスプレイを一旦作成する。

vncserver :1

ここで、パスワードの設定が求められるので設定する。
このパスワードはクライアントPCから、サーバーにリモートデスクトップ接続をする際に入力する。
次の質問は、nを入力する。
Would you like to enter a view-only password (y/n)? n

emacsを使う人は、ここでemacsをインストールする。

sudo apt install emacs

~/.vnc/xstartupを次の内容にする。(emacsを使用する場合: emacs .vnc/xstartup)

#! /bin/sh

exec gnome-session &

先ほど作ったディスプレイ:1をkillして再起動する。killしないでrebootすると、:1に正常にアクセスできない(staleになっている)。

vncserver -kill :1
sudo reboot

次にログインをする際には、sshのコマンド末尾に、次のオプションをつける。

-L 5901:localhost:5901

このオプションで、サーバーの5901番ポートと、ローカルホストの5901番ポートに接続可能となる。
VNCサーバーで:1のディスプレイを作成すると5901番を使用する。
ログイン後、次のコマンドでリモートアクセスするディスプレイを作成する。

vncserver :1

ターミナルはそのままにして、クライアントPCからサーバーへのリモートデスクトップ接続の操作を行う。ターミナルからのSSH接続でサーバーの5901番ポートとクライアントPCの5901番ポートを接続しているので、ログアウトしたり、ターミナルを終了すると、リモートデスクトップ接続はできない。
(MacOSXの場合)

・Finderを起動
・画面上端のメニュー(Finderのメニュー)から"移動"-> "サーバーへ接続"を選択する
・"サーバーへ接続"のダイアログに、vnc://localhost:5901
を入力する。
・VNC接続のパスワードを聞かれるので、上で設定したパスワードを入力すると、サーバーにリモートデスクトップ接続する。

この手順は、MacOSXの標準機能のみでリモートデスクトップ接続が可能。しかし、この方法で接続すると、クライアントPCとクリップボードを共有できなかった。VNC ViewerをMacにインストールして、localhost:5901に接続すると、クリップボードの共有は可能だった。

(Windowsの場合)
UltraVNCで接続可能だった。

以下、コマンドは、サーバー側でディスプレイの確認・削除・作成で使用するもの。

ディスプレイの確認:
vncserver -list

ディスプレイの削除:
vncserver -kill :(ディスプレイ番号)

ディスプレイの作成:
vncserver :(ディスプレイ番号)