2017年12月5日 星期二

Manage LXC Virtual Machines


Start VM

ubuntu@ip-172-31-16-58:~$ sudo lxc-start -n myBig1 (default start vm by backend)

Connect by Console

ubuntu@ip-172-31-16-58:~$ sudo lxc-console -n myBig1

Connected to tty 1
                  Type <Ctrl+a q> to exit the console, <Ctrl+a Ctrl+a> to enter Ctrl+a itself

Ubuntu 16.04.3 LTS myBig1 pts/0

myBig1 login: ubuntu (default from template)
Password:
Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-1041-aws x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

ubuntu@myBig1:~$ hostname
myBig1
ubuntu@myBig1:~$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:16:3e:2e:90:28
          inet addr:10.0.3.36  Bcast:10.0.3.255  Mask:255.255.255.0 (使用A class networking)
          inet6 addr: fe80::216:3eff:fe2e:9028/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:13 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1554 (1.5 KB)  TX bytes:1374 (1.3 KB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)


ubuntu@myBig1:~$ ubuntu@ip-172-31-16-58:~$  (Type <Ctrl+a q> to 離開 console)

查詢LXC VM Status

ubuntu@ip-172-31-16-58:~$ sudo lxc-ls -f
NAME          STATE   AUTOSTART GROUPS IPV4      IPV6
myBig1        RUNNING 0         -      10.0.3.36 -
myBig1_Backup STOPPED 0         -      -         -


ubuntu@ip-172-31-16-58:~$ sudo lxc-start -n myBig1
ubuntu@ip-172-31-16-58:~$ sudo lxc-stop -n myBig1

自訂Linux 指令 Edit .bashrc file

End of +
alias ping='ping -c 4'
alias bye='sudo shutdown -h now'

中文化 skip
終端機分頁 skip?
Batch start/stop VM skip

沒有留言:

張貼留言

check_systemv1.1

 check_systemv1.1.bat 可用於電腦資產盤點 @echo off REM 後續命令使用的是:UTF-8編碼 chcp 65001 echo ***Thanks for your cooperation*** echo ***感謝你的合作*** timeout 1...