Starting up Ubuntu

Machine Learning Artificial Intelligence Natural Language Processing Semantic Web Search Technology DataBase Technology Ontology Technology Algorithm Digital Transformation UI and DataVisualization Workflow & Services IT Infrastructure OS Technology Navigation of this blog

About Ubuntu

From the “Ubuntu Startup Bible,”In this article, we will discuss the details and implementation of Ubuntu. For an overview of Linux, see “Linux Overview“.

this article describes the startup of Ubuntu.

Linux is running on various devices such as servers, smart phones, TVs, and digital cameras, and Linux holds an overwhelming share in the market. The most widely used Linux distribution is “ubuntu”. (Among web servers where linux is used, Ubuntu’s share is the largest at 34% (2018), and Ubuntu’s share is also large as a server OS to be installed in the cloud or containers.)

Since Ubuntu is distributed free of charge, it is easy for individuals to download and run it on their own PCs, and by installing VirtualBox, a virtual PC software on Window or macOS, it can be run without the need for another PC.

There are two types of Ubuntu that can be installed on ordinary PCs: “Ubuntu Desktop” and “Ubuntu Server.

Installing Ubuntu Desktop in VirtualBox

First, regarding the installation of Ubuntu Desktop, the “ISO image file” for installing Ubuntu Desktop can be downloaded from the official website.

If you download Ubuntu directly to your PC, write the ISO image file to a USB memory stick or DVD-R and boot your PC with the media.

To install Ubuntu on VirtualBox (an open source virtual PC software that emulates a PC in a software-like manner, allowing another OS to run as if it were an application), first download VirtualBox from the Oracle VM Download the installer for each OS from the VirtualBox website downloads, and then run the installer to download the software. (Basically, press “YES” as default.)

When the installation is complete, a completion screen will be displayed, so press the “Finish” button to start VirtualBox. (In the case of Windows, VirtualBox will not work if the virtualization system “Hyper-V” provided by Microsoft is enabled, so to disable Hyper-V, open “Control Panel” -> “Programs” -> “Enable or Disable Programs Yesterday” and click Set the check box for “Virtual-V” to “Off”, press the “OK” button, and reboot)

After VirtualBox starts, click the “New” icon on the left of the toolbar to display a dialog box for settings. Enter an easy-to-understand name (if you enter a name that includes ubuntu, “linux” will automatically be selected as the type and “ubuntu(64bit)” as the version) and click the “Next” button.

The memory size can be installed with “1-24 (1GB)”, but if you want to use ubuntu desktop, set the memory size to “2048 (2GB)” or more. (This value can be changed after the virtual PC is created.

VirtualBox creates one file in the host OS and treats it as a “virtual hard disk”. From the guest OS, this file looks like a single hard disk. For a new installation, leave “Create a virtual hard disk” as it is and press the “Next” button.

The default file type of the virtual hard disk is “VDI”, and click the “Next” button.

The storage on the physical hard disk is also usually left at the default “Variable Size”. If this setting is selected, the size of the virtual hard disk file will not grow until the data is plowed into it. If “Fixed Size” is selected, a file will be created on the host OS with the same size as the virtual disk size, which is specified in the next dialog.

The file name is the same as that of the virtual machine by default. The default size of the virtual disk is “10GB”, but since installing Ubuntu alone consumes about 7GB, the size should be 25GB or more if you want to add various applications.

If you leave “Variable Size”, you can specify the maximum size of 2TB, because even if you specify a large size, a large file will not be created immediately (however, if you keep writing data, it will grow up to 2TB).

Click the “Create” button to create a virtual PC and add it to the VirtualBox main window. Select the added virtual PC and click the “Start” icon on the toolbar to open a new window and start the virtual PC.

When the “Select Boot Disk” dialog box appears, click the icon to the right of the drop-down list, select the ISO image file downloaded from the “L2 Ubuntu Download” menu, and click “Boot” to boot the virtual PC from the ISO image file.

Install Ubuntu Desktop directly on your PC

To install Ubuntu directly on your PC, you will need to create an “installation media” on USB or DVD-R using the ISO image file you downloaded.

To do this, first prepare a USB flash drive with a capacity of 2 GB or more (recommended because of shorter boot time than DVD-R), access the Rufus site with a Web browser, and download the latest version linked to the site. After executing the downloaded file, Rufus’ update policy will appear and pressing “Yes” will allow you to be notified when a new version is released.

When the main Rufus pictorial window appears, place the prepared USB memory in the PC and make sure that the “Boot type” is set to “Disk or ISO image”. After confirming that the drive of the memory is the correct one, press the “Start” button. The first time you run the program, a dialog box will appear prompting you to download a new “SYSLINUX”, press “Yes” to proceed. (SYSLINUX is a program called a “boot loader” used to boot Linux from USB memory, DVD, CD, etc.)

Next, a dialog box will appear to select the write mode. This is because Ubuntu ISO images are processed by the “ISOHybrid” program so that they can be booted even if they are written directly to ESB memory.

Normally, leave “Write in ISO image mode” as it is. It takes a few minutes to write the ISO image file, and when the writing is finished, remove the USB memory stick.

Insert the USB memory stick for installation into the PC and boot it. After the installation file is loaded, Ubuntu will start booting. (If it does not boot properly, you will need to review the BIOS settings for the drive to be loaded, etc.)

Installing Ubuntu

When the Ubuntu installation begins, the installation will go through the keyboard layout, settings for applications to be installed, storage settings (which storage to put Ubuntu in), time zone settings, user account settings, etc. Once the installation is complete, you will need to reboot.

Ubuntu Server Installation

Next, we will discuss the installation of the Ubuntu server. First, download the server ISO (e.g. Ubuntu Server 22.04 LTS) from the ubuntu download site.

The server version has different network settings than the desktop version. First, when installing in VirtualBox, the default network adapter “Assign” is set to “NAT”, and although it is possible to install Ubuntu Server as is, it is not possible to connect from other PCs to server programs running on Ubuntu (SSH server, Web server, etc.). However, it is not possible to connect to server programs running on Ubuntu (SSH server, Web server, etc.) from other PCs. By changing to “Public Network”, Ubuntu running as a guest OS can be connected to a physical LAN. After that, refer to the aforementioned “Installing Ubuntu Desktop in VirtualBox” and boot the virtual PC with the downloaded ISO image file.

To install Ubuntu Server on a real PC, the ISO image file must be written to a USB memory stick or similar device to create an installation media.

When the PC is booted with the live media of the server version, the installer will start. Since there is no Japanese version, leave “English” and press “Enter” to select the language.

If you press “Alt+F2” during installation, the login process to the ubuntu server running as a “live session” will be executed, and a Bash prompt will be displayed. You can use it as a ubuntu server as it is, but any files you have created or modified will be lost when you exit the system.

Next, a keyboard selection screen will appear. To select a Japanese keyboard, press “up” several times to invert “English” under “Layout” and press “enter. A list will be displayed. Use the cursor keys to select “Japanese” and press “enter”. Now both “Layout” and “Variant” will be set to “Japanese”. Use the cursor keys to select “Done” and press “enter” to proceed.

Select the installation type. If you want to install as a normal Ubuntu server, leave “Install Server” and press “enter”.

Next, a list of network interfaces will be displayed. By default, it is configured to obtain network settings such as IP address from a DHCP server.

To use it as a server, it is common to set a fixed IP address. Press “up” to select the network interface, and press “enter” to change the settings.

If you are undecided about the IP address that can be set and gilded, there is no problem in proceeding with the setting to obtain an IP address automatically. After installation, you can change to a fixed IP address.

This section describes how to manually set the IPv4 address and other settings. Select “Use a static IPv4 configuration” and press “enter”.

Set the subnet, address, gateway, and name servers. Leave the search domain blank if you do not need it.

After pressing “Done” to complete the network settings, the HTTP Proxy Settings screen will appear. If you need to use a proxy for external HTTP access, configure the settings.

Next, configure the file system settings. Here, select “Use An Enter Disk” to use the entire disk. It is also possible to set manually by selecting “Manual.

Select the disk to be used and press “enter”.

Set the file system. By default, “ext4” is selected, but if there is no problem, press “enter” as it is.

The final confirmation before writing to the disk is shown. If you wish to continue, select “Continue” and press “enter.

Enter your name, server name, user name, and password, then select “Done” and press “enter.

When the installation progresses and the completion screen appears, select “Reboot Now” and press “enter”.

The Ubuntu server will start and the installation will be complete when the login prompt appears.

First, upgrade to the updated package.

$ sudo apt updata
$ sudo apt upgrade

Next, check the operational status of the OpenSSH server in order to make a remote connection via SSH (Secure Shell).

$ systemctl status sshd

If you see “active (running)” when you enter the above command, sshd is running. If not, type “sudo apt install openssh-server” to install it.

Confirm the IP address of the network interface (Ethernet interface) that is used to connect to the OpenSSH server running on Ubuntu from other PCs.

$ networkctl status

       Status:   routable
      Address:   192.168.111.35 on erp0s3
      

In the above example, the network interface named erp0s3 has an Ipv4 address of “192.168.111.35”.

See “Introduction to Amazon Web Services Networking (4) Connecting and Verifying Instances to the Internet” for SSH verification.

コメント

タイトルとURLをコピーしました