ICS2017 Programming Assignment
  • Introduction
  • PA0 - 世界诞生的前夜: 开发环境配置
    • Installing a GNU/Linux VM
    • First Exploration with GNU/Linux
    • Installing Tools
    • Configuring vim
    • More Exploration
    • Transferring Files between host and container
    • Acquiring Source Code for PAs
  • PA1 - 开天辟地的篇章: 最简单的计算机
    • 在开始愉快的PA之旅之前
    • 开天辟地的篇章
    • RTFSC
    • 基础设施
    • 表达式求值
    • 监视点
    • i386手册
  • PA2 - 简单复杂的机器: 冯诺依曼计算机系统
    • 不停计算的机器
    • RTFSC(2)
    • 程序, 运行时环境与AM
    • 基础设施(2)
    • 输入输出
  • PA3 - 穿越时空的旅程: 异常控制流
    • 更方便的运行时环境
    • 等级森严的制度
    • 穿越时空的旅程
    • 文件系统
    • 一切皆文件
  • PA4 - 虚实交错的魔法: 分时多任务
    • 虚实交错的魔法
    • 超越容量的界限
    • 分时多任务
    • 来自外部的声音
    • 编写不朽的传奇
  • PA5 - 从一到无穷大: 程序与性能
    • 浮点数的支持
    • 通往高速的次元
    • 天下武功唯快不破
  • 杂项
    • 为什么要学习计算机系统基础
    • 实验提交要求
    • Linux入门教程
    • man入门教程
    • git入门教程
    • i386手册指令集阅读指南
    • i386手册勘误
    • 指令执行例子
Powered by GitBook
On this page
  • SSH configuration
  • For GNU/Linux and Mac users
  • For Windows users
  • First exploration

Was this helpful?

  1. PA0 - 世界诞生的前夜: 开发环境配置

First Exploration with GNU/Linux

PreviousInstalling a GNU/Linux VMNextInstalling Tools

Last updated 6 years ago

Was this helpful?

To start the container, type the following command in the terminal:

docker start ics-vm

This command will start the container with name ics-vm, which is created by us. By defualt, ics-vm will start in detach mode, running the SSH deamon instructed at the end of the Dockerfile. This means we can not interact with it directly. To login the container, we should do the SSH configuration first.

SSH configuration

According to the type of your host operating system, you will perform different configuration.

For GNU/Linux and Mac users

You will use the build-in ssh tool, and do not need to install an extra one. Open a terminal, run

ssh -p 20022 username@127.0.0.1

where username is the user name in Dockerfile. By default, it is ics. If you are prompted with

Are you sure you want to continue connecting (yes/no)?

enter "yes". Then enter the user password in Dockerfile. If everything is fine, you will login the container via SSH successfully.

For Windows users

Windows has no build-in ssh tool, and you have to download one manually. Download the latest release version of putty.exe . Run putty.exe, and you will see a dialog is invoked. In the input box labeled with Host Name (or IP address), enter 127.0.0.1, and change the port to 20022. To avoid entering IP address and port every time you login, you can save these information as a session. Leave other settings default, then click Open button. Enter the container user name and password in Dockerfile. If everything is fine, you will login the container via SSH successfully.

First exploration

After login via SSH, you will see the following prompt:

username@hostname:~$

This prompt shows your username, host name, and the current working directory. The username should be the same as you set in the Dockerfile before building the image. The host name is generated randomly by Docker, and it is unimportant for us. The current working directory is ~ now. As you switching to another directory, the prompt will change as well. You are going to finish all the experiments under this environment, so try to make friends with terminal!

Many of you always use operating system with GUI, such as Windows. The container you just created is without GUI. It is completely with CLI (Command Line Interface). As you entering the container, you may feel empty, depress, and then panic...

Calm down yourself. Have you wondered if there is something that you can do it in CLI, but can not in GUI? Have no idea? If you are asked to count how many lines of code you have coded during the 程序设计基础 course, what will you do?

GUI wins when you do something requires high definition displaying, such as watching movies. But in our experiments, GUI is unnecessary. Here are two articles discussing the comparision between GUI and CLI:

Now you can see how much disk space Debian occupies. Type the following command:

df -h

You can see that Debian is quite "slim".

To shut down the container, first type exit command to terminate the SSH connection. Then go back to the host terminal, stop the container by:

docker stop ics-vm

And type exit to exit the host terminal.

If you stick to Visual Studio, you will never understand why vim is called . If you stick to Windows, you will never know what is . If you stick to GUI, you can only do what it can; but in CLI, it can do what you want. One of the most important spirits of young people like you is to try new things to bade farewell to the past.

here
编辑器之神
Unix Philosophy
Why Use a Command Line Instead of Windows?
Command Line vs. GUI