Wake up or sleep a remote computer in Ubuntu

Source: Internet
Author: User

Notice: the remote wakeup is not only about wake-up within the LAN, but even over the Internet.


1. Check whether the computer hardware supports the wol (Wake on LAN) function. 1. Check whether the motherboard and power supply support wol

Enter the power management setup of bios and set PME event wake up (which is actually a wake on PCI Card mode) to enabled. Note that some machines may be wake on LAN or wake on PCI Card. The wake on LAN mode can be used to wake up when the system is completely shut down, while the wake on PCI Card mode must be used to wake up in the deep sleep mode. The main reason for this difference is that the design of the motherboard is different. The current computers are generally in the wake on PCI Card mode.

. Check whether the NIC supports Wol.

Install ethtool and run the following command:

sudo apt-get install ethtoolsudo ethtool eth0 |grep Wake-on

If the result is as follows, the NIC supports Wol:

Supports Wake-on:pumbgWake-on : g
2. remotely control the computer to enter the deep sleep or completely shut down state

SSH is used to connect to a remote computer and command requests are submitted to achieve this goal.

. Use the Ubuntu terminal to log on to a remote computer

For more information, see connect to a remote computer on the Ubuntu terminal.

2. After logging on to a remote computer, run the following command to perform deep sleep or shutdown:
# Deep Sleep sudo pm-hibernate # shutdown sudo shutdown 0
3. Wake up remote computer 3. 1. Preparations
  • Know the IP address, domain name, and MAC address of the remote computer, and bind the lan ip address and MAC address to the route. If there is no static IP address, you can use a peanut shell. Detailed operations can be performed on Google, which will not be detailed here.
  • Install the Remote Wake-up tool wakeonlan on the local computer:
    sudo apt-get install wakeonlan
. Wake up a remote computer

Run the following command to wake up a remote computer:

# Host_address is the domain name or IP address of the remote computer, mac_address is the MAC address of the remote computer, and the MAC address is ':' in the form of interval wakeonlan-I host_address mac_address
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.