在 Windows 10 上面跑的 Ubuntu / bash …

上個月(2016/03)底,今年微軟 Build 大會最讓人震驚的消息,沒有之一,透過微軟跟 Canonical (開發 Ubuntu 的公司) 的合作,未來可以在 Windows 10 上面跑原生的 Ubuntu / bash,不是跑在虛擬機或使用模擬器、容器等技術,是原生的!有了這個重大的改變,或許未來都不需要使用到 cygwin、msys 或 GnuWin 這種專案了?一時沒空把所有資訊都看完,先來整理一些筆記 …

這項更新目前已經有測試版可以玩了,正式的版本預計在今年夏天的 Windows 10 年度更新釋出,之後就會在 Windows 10 上面有一個完整的 Ubuntu user space 子細統,不但 Linux 上常見的 utilities 如 grep, sed, awk 等工具未來都可以直接跑在 Windows 10 上,甚至 Debian / Ubuntu 在使用的套件管理系統 apt 也都可以直接使用,不論是對於使用者或是開發者都提供了更大的彈性以及便利性,同時代表未來 Windows 對 Linux 或其他原先只能跑在 unix-like OS 的專案會更加的友善。

微軟現在甚至使用 GitHub 來當 BashOnWindows 的 issue tracker:

https://github.com/Microsoft/BashOnWindows/issues

Microsoft-BashOnWindows-issues-on-GitHub.png

然後也有一個在 uservoice 上面的討論、反應平台:

https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/category/161892-bash

我從底下會提到的 Linux Command Line on Windows 影片,截了一些畫面出來:

可以看到 lsb_release -a 看到的是 Ubuntu 14.04.4 LTS:

screenshot-from-Linux Command Line on Windows-video-ll-lsb_release-a.png

示範一些常見的工具,例如 fdisk 、mount,還有貼上文字的功能:

screenshot-from-Linux Command Line on Windows-video-fdisk-and-mount-and-paste.png

透過 apt install gcc 來安裝 gcc:

screenshot-from-Linux Command Line on Windows-video-demo-apt-install-gcc.png

閱讀全文

Play with ReactOS live CD v0.4.0 – the Windows compatible operating system

ReactOS is a free and open source operating system for x86/AMD64 PSs, based on the best design principles found in the Windows NT architecture, development started in 1996 as Windows 95 clone project, continued as ReactOS in 1998, the goal of ReactOS is “binary compatible with Windows”, that’s awesome, the latest major release – v0.4.0 was announced last month(Feb 2016), it’s about ten years from the previous major release, okay, let’s take a look at the latest ReactOS.

The features of ReactOS:
reactos_features

What’s the difference between ReactOS v0.3.x and v0.4.0? The highlights from the official news – ReactOS 0.4.0 Released:

  • ext2 read/write and NTFS read support
  • New explorer shell and theme support
  • SerialATA support
  • Sound support
  • USB support
  • VirtualBox and VirtualPC support
  • Wireless networking
  • CMake support for GCC and MSVC compilation
  • Compilation times significantly improved
  • GDB remote debugging interface for kernel debugging
  • WinDBG support
reactos_0.3.0-vs-0.4.0-features.png

From: http://community.reactos.org/index.php/features/reactos-0-4

Looks not so cool if you compare it with some popular operating systems like Windows, FreeBSD, Mac OS X or Ubuntu GNU/Linux, but it’s a huge step of ReactOS, if you would like to take a look at it, ReactOS provides live CD iso image, you can also install it by yourself, or download pre-installed VirtualBox/VMware image, I’ll use live CD in VirtualBox virtual machine to demonstrate ReactOS as below.

ReactOS download: https://reactos.org/download / https://sourceforge.net/projects/reactos/files/latest/download

The size of zipped file(ReactOS-0.4.0-live.zip) is about 66MB, the size of the extract iso file(ReactOS-0.4.0-Live.iso) is about 198MB, compare to currently popular operating systems, it’s really tiny!

This is the first screen of ReactOS, the boot menu, there are 4 options here, but there isn’t significant difference for end-users, the most different thing may be the booting progress will be shown during the process:

Press F8 to advanced boot menu:

Booting, looks like the classic Windows XP:
reactos_livecd_booting.png

reactos_livecd_booting2.png

Hardware detecting and installing:
reactos_livecd_booting3.png

Booting finished, took me only few seconds, very fast, here’s the Desktop screenshot:
reactos_livecd_desktop

My computer:
reactos_livecd_my_computer

System Properties:
reactos_livecd_properties_general

閱讀全文

在 Windows 10 上安裝 VirtualBox v5.0 筆記

VirtualBox 在 Windows 10 的安裝流程紀錄,沒什麼特別難或特別要注意的地方,就只是一個流程紀錄。還不認識 VirtualBox 的畫可以 Google 搜尋一下虛擬機、VirtualBox 的相關資訊,VirtualBox 是一套免費、開放原始碼的自由軟體虛擬化軟體,可以幫我們模擬一套電腦硬體,讓使用者在上面做各式的練習、開發(例如安裝FreeBSD, Linux),或是硬體資源管理。

FreeBSD 、 Linux 建議可以透過系統的套件庫來安裝,不過結至目前為止,FreeBSD 的 ports/pkg 都還停留在 4.3.34 版 , Ubuntu 則是要 Wily (15.10)、 xenial (16.04) 才有 v5.0 的 VirtualBox、其他版本則需要從 VirtualBox 官網下載安裝。

VirtualBox 官網: https://www.virtualbox.org/

點選 Download VirtualBox 5.0

virtualbox.org_v5.0

VirtualBox 5.0.12 for Windows hosts x86/amd64

virtualbox.org_download virtualbox.org_download_finished下載後執行安裝程式:

virtualbox.5.0_install

設定要安裝的元件有哪些,這部分不用特別調整,下一步即可:

virtualbox.5.0_install_2

閱讀全文

Remotely shutdown/restart Windows via Linux on Debian/Ubuntu based Linux

Need samba-common package first, install via apt:

$ sudo apt-get install samba-common

Then use this command to shutdown the computer remotely(replace ip, username and password with your own):

$ net rpc shutdown --ipaddress ip --user username%password

Add -r if you want to restart, not shutdown:

$ net rpc shutdown -r --ipaddress ip --user username%password

After execution, here is the success message:

Shutdown of remote machine succeeded

If receive these messages below means something failed:

Could not connect to server 192.168.1.55
Connection failed: NT_STATUS_IO_TIMEOUT
Connection failed: NT_STATUS_RESOURCE_NAME_NOT_FOUND
Could not initialise pipe winreg. Error was NT_STATUS_OBJECT_NAME_NOT_FOUND

There are many functions provide by net [rpc], like:

net rpc audit Modify global audit settings
net rpc info Show basic info about a domain
net rpc join Join a domain
net rpc oldjoin Join a domain created in server manager
net rpc testjoin Test that a join is valid
net rpc user List/modify users
net rpc password Change a user password
net rpc group List/modify groups
net rpc share List/modify shares
net rpc file List open files
net rpc printer List/modify printers
net rpc changetrustpw Change trust account password
net rpc trustdom Modify domain trusts
net rpc abortshutdown Abort a remote shutdown
net rpc shutdown Shutdown a remote server
net rpc samdump Dump SAM data of remote NT PDC
net rpc vampire Sync a remote NT PDC’s data into local passdb
net rpc getsid Fetch the domain sid into local secrets.tdb
net rpc rights Manage privileges assigned to SID
net rpc service Start/stop/query remote services
net rpc registry Manage registry hives
net rpc shell Open interactive shell on remote server
net rpc trust Manage trusts
net rpc conf Configure a remote samba server

Check man rpc for more details!