5/21/2018

Ubuntu 16.04 LTS Version 설치 및 설정

1. Ubuntu 16.04 설치 

기존까지 Ubuntu 14.04 LTS 64bit 와 Ubuntu 12.04 LTS 64bit Version으로만 이용하다가 얼마전에 Ubuntu가 18.04 Release가 되었으며,
Ubuntu 16.04도 더이상은 최신 Version 이라고 할수 없을 것 같아 이를 설치해보고 현재 Ubuntu의 최신기능과 관련부분을 알아보도록 하자.

  https://www.ubuntu.com

  • 다양한 CPU지원 
Ubuntu가 Desktop 및 Server 와 IOT와 Cloud 로 분류가 되어서 나오고 있으며, x86을 벗어난 ARM64 까지 지원을 하고 있다.
집에 있는 Odroid 및 다른 EVM에서 여러번 봤지만 공식 홈페이지에서 보기는 이번이 처음이다.

  • Could 기능 및 OpenStack 지원 
Docker 기반으로 Container를 이용하여 쉽게 설치 지원이 가능하며, Kubernetes도 현재 지원이 되고 있는 상황이다
이미 Docker기능 및  Jenkins로 이전 Version에서 사용을 했지만, 공식사이트에서 보니 새롭다.

  https://www.ubuntu.com/containers


  • 설치문서 
  https://tutorials.ubuntu.com/tutorial/tutorial-install-ubuntu-desktop?_ga=2.9632694.2071981096.1526908963-614826485.1523275796#8


1.1 Download Ubuntu Image

Virtual Box 기반으로 최소의 용량을 사용하기 위해서 Desktop Version으로 설치진행

  • Download Mirror Site 
  https://launchpad.net/ubuntu/+cdmirrors?_ga=2.206215952.2071981096.1526908963-614826485.1523275796
  http://mirror.kakao.com/ubuntu-releases/16.04/


  ubuntu-16.04.4-desktop-amd64.iso


1.2  Virtual Box 기본설정 

Virtual Box 설치 및 설정은 크게 변경된 것이 없음으로 아래와 같이 동일하게 구성을 하자
  1. 기본 Ubuntu VDI 30G 새로생성 
  2. 생성된 VDI를  용량최소화위해 동적할당 설정 
  3. 네트워크->브리지 어댑터 (어댑터에 브리지) 설정 
  4. 메모리 설정 변경 (본인의 램의 절반수준)
  5. 공유폴더 설정 (추후 설정)
  6. 저장소 설정 IDE 에 Ubuntu Image ISO 추가 
  https://ahyuo.blogspot.kr/search/label/Virtual%20Box


2. Ubuntu 16.04 LTS 기본설치 

  • 기존과 동일하게 설정 
  1. 설치->언어 : 한국어 설정 
  2. 설치->키보드 배치 : 한국어- 한국어 (101/104키호환)
  3. 설치->이름/컴퓨터이름 설정 (계정설정)

설치후 자동으로 IDE의 Ubuntu Image ISO가 제거됨
이전과 다르게 다른 VDI를 자동으로 잡으며 이를 바로 볼수 있다.

  • 기본설치 후 Virtual Box 확장패키지 설치 
  1. 좌측의 맨위 검색에서 Terminal 검색 및 런처에 고정 
  2. 장치->게스트 확장 CD 이미지 삽입 
  3. 실행 및 암호입력 
  4. Ubuntu Reset 

  • Virtual Box Machine 부분 설정 
  1. 일반->고급  클립보드:  양방향 설정 
  2. 일반->고급 드래그 앤 드롭: 양방향 설정 

3. Ubuntu 기본환경 설정 

우선 좌측 상위 맨위 검색버튼을 눌러 Terminal을 검색하여 실행한 후 이를 런처에 고정하자.

  • SSH Server 설정
$ sudo apt-get install openssh-server
$ sudo apt-get install vim     // vim 방향키 문제가 있어 다시 설치 


  • SSH Client - Xshell4 에러 (Xshell6 변경)
등록 정보 ->SSH -> 보안 -> 암호화 설정  확인해보면 해결된다고 하는데, 설정을 봐도 크게 이상이 없다
현재 Xshell4의 보안 알고리즘이 지원을 못한다 그래서 Xshell 6으로 변경 후 아래의 증상은 해결되었다.


  https://www.netsarang.co.kr/forum/xshell/2155/%EC%95%94%ED%98%B8_%EC%95%8C%EA%B3%A0%EB%A6%AC%EC%A6%98_%EC%97%90%EB%9F%AC


  • Samba 설정 
$ sudo apt-get install samba  

$ sudo smbpasswd -a jhlee 
New SMB password:
Retype new SMB password:
Added user jhlee.

$ sudo vi /etc/samba/smb.conf   
.......
#======================= Share Definitions =======================

[homes]
comment = Home Directories
valid users = %S
read only = no
;read/write 가능하게 설정하고 싶다면 아래와 같이 설정 
;read only = no or writable = yes 
;read only 만 할 경우는 yes로 설정 
browseable = Yes
;create mask = 0755
;directory mask = 0755

$ sudo /etc/init.d/smbd restart // Samba Server Restart!

본인이 편하다고 생각이 들면 윈도우 탐색기에서 네트워크 드라이브 연결 (옵션)


  • GIT 설치
$ sudo apt-get install git 


  • 공유폴더 설정
아래와 같이 권한을 설정을 한 후

$ sudo vi /etc/group 
    .....
    .....
    vboxsf:x:1001:jhlee  --- > vboxsf 찾은 다음  자신의 ID  추가 

Virtual Box->설정->공유폴더 설정


아래와 같이 공유 확인 가능

$ ls /media/sf_SHARED/
....


3.1 Virtual Box의 VDI 추가 및 확인  

  • 기존 사용하던 VDI 및 새로생성할 VDI 확인  
  1. Virtual Box에서 저장소->SATA에 기존에 사용중 VDI or 새로생성한 VDI를 추가 
  2. Ubuntu 로 부팅 후  각 개별 command로 확인 
  3. df -h 용량 확인 
  4. cat /proc/partitions  // VDI 정보확인 
  5. sudo fdisk -l  // VDI 정보 확인 


$ df -h    // 사용되는 Filesystem 용량을 간단히 확인 
Filesystem      Size  Used Avail Use% Mounted on
udev            971M     0  971M   0% /dev
tmpfs           200M  3.9M  196M   2% /run
/dev/sda1        28G  4.4G   22G  17% /
tmpfs           997M  212K  997M   1% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           997M     0  997M   0% /sys/fs/cgroup
SHARED          267G  169G   99G  64% /media/sf_SHARED
tmpfs           200M   40K  200M   1% /run/user/1000

$ cat /proc/partitions       // 새로 생성된 VDI 및 기존 VDI를 추가 했기때문에 이를 확인 
major minor  #blocks  name

  11        0    1048575 sr0
  11        1    1048575 sr1
   8        0   31457280 sda    // Ubuntu VDI 
   8        1   29359104 sda1
   8        2          1 sda2
   8        5    2095104 sda5
   8       16   31457280 sdb     // 새로 생성한  VDI 2번째 , 새로 생성하여 Partition을 잡아야한다. 
   8       32   31457280 sdc     // 기존에 존재하던 VDI 3번째  
   8       33   31456256 sdc1
   8       48   31457280 sdd     // 기존에 존재하던 VDI 4번째  
   8       49   31456256 sdd1
$ lsblk 


  • 새로생성한 VDI  Partition 설정 및 FS Format
상위에서 새로 추가된 VDI 설정확인

 $ sudo fdisk /dev/sdb // 상위에서 확인한 새로 추가된 VDI 
Welcome to fdisk (util-linux 2.27.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x9975df29.

Command (m for help): n     // Partion 추가 
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-62914559, default 2048): 
Last sector, +sectors or +size{K,M,G,T,P} (2048-62914559, default 62914559): 

Created a new partition 1 of type 'Linux' and of size 30 GiB.

Command (m for help): p    // 추가된 Partion 확인 
Disk /dev/sdb: 30 GiB, 32212254720 bytes, 62914560 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x9975df29

Device     Boot Start      End  Sectors Size Id Type
/dev/sdb1        2048 62914559 62912512  30G 83 Linux

Command (m for help): w  // 저장  
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

$ sudo mkfs.ext4 /dev/sdb1  // 새로 생성된 Partition 을 EXT4로 포맷 


3.2 추가된 VDI의 자동마운트 

UUID는 Partition을 생성을 한 후에 이 값을 얻을 수 있으므로,  다음과 같이 sdx1 x는 drive를 말하고 1은 Partition을 말한다.
만약 추가했지만, 잡히지 않는다면, 위의 fdisk에서 새로 잡도록하자.

$ ls -l /dev/disk/by-uuid/  
or 
$  sudo blkid
lrwxrwxrwx 1 root root 10  5월 23 21:06 35e74ae8-80c1-4832-bff6-674b4a93d6c2 -> ../../sdd1
lrwxrwxrwx 1 root root 10  5월 23 21:06 b771bdc7-e7f7-454b-a48a-df598833169d -> ../../sdc1
lrwxrwxrwx 1 root root 10  5월 23 21:06 ce6b9446-1e0f-4330-b7e9-923a06501ae9 -> ../../sda5
lrwxrwxrwx 1 root root 10  5월 23 21:06 ed70c2a9-0c95-4e4e-81d8-9bdf6adfe839 -> ../../sda1
lrwxrwxrwx 1 root root 10  5월 23 21:06 ff6cb88e-963c-4bf2-ab67-f24b9e7918b5 -> ../../sdb1

$ sudo vi /etc/fstab

UUID=ed70c2a9-0c95-4e4e-81d8-9bdf6adfe839 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=ce6b9446-1e0f-4330-b7e9-923a06501ae9 none            swap    sw              0       0

 
## 새로 mount할 곳 ,뒤에 옵션 현재는 동일하게 사용 중, errors=remount-ro 0       1 

##RaspberryPI                                                     
UUID=ff6cb88e-963c-4bf2-ab67-f24b9e7918b5 /home/jhlee/raspberrypi   ext4    errors=remount-ro     0       1 

- 저장후 재부팅 

$ sudo chown jhlee:jhlee -R raspberrypi 

이제 생성된 UUID기반으로 /etc/fstab에서 설정을 해주자.


  • 자세한 내용은 아래 참고 
  https://ahyuo.blogspot.kr/2013/12/virtual-box-ubuntu-1204.html

댓글 없음 :