首页 > xen > 使用xen-shell来管理xen vps

使用xen-shell来管理xen vps

2010年6月9日 eric 发表评论 阅读评论

XEN 的强大管理工具 XEN-SHELL,用他来管理XEN的虚拟机,简直是太方便了。太强大了,支持系统重装,VPS 启动、重启、关机、暂停,连接控制台。

 wget http://xen-tools.org/software/xen-shell/xen-shell-1.9.tar.gz
tar zxvf xen-shell-1.9.tar.gz

cd xen-shell

make

make install

1.建立连接VPS的用户与密码

useradd eric

passwd eric

useradd yangzi

passwd yangzi

2.给用户 sudo 的命令权限,和登录shell

vim /etc/sudoers

#加入以下

User_Alias   XENUSERS = eric,yangzi

Cmnd_Alias   XEN      = /usr/sbin/xm

Cmnd_Alias   XENIMG  = /usr/bin/xen-create-image

XENUSERS     ALL    = NOPASSWD: XEN,XENIMG

# 执行下列命令,让用户登录到 xen-shell

chsh -s /usr/local/bin/xen-login-shell eric

chsh -s /usr/local/bin/xen-login-shell yangzi

3.修改xen 虚拟机的配置文件,加入

xen_shell = "eric"

例如:

kernel = "/boot/vmlinuz-2.6.24-28-xen"

ramdisk = "/boot/initrd.img-2.6.24-28-xen"

memory = "64"

name = "xenyang"

xen_shell = "eric"

disk = ['phy:/dev/md0,sda1,w']

root = "/dev/sda1 ro"

on_poweroff = 'destroy'

on_reboot = 'restart'

on_crash = 'restart'

vcpus   = '2'

extra = 'xencons=tty1'

vif = [ '' ]

4.(可选)如果你需要用xen-shell 来重装系统的话,就做这步

在eric 的home 目录下新建image.sh

cd /home/eric

vim image.sh

#!/bin/sh

/usr/bin/sudo /usr/bin/xen-create-image --hostname=yang \

 --size=1.5Gb \

 --ide \

 --ip=192.168.6.36 \

 --netmask=255.255.255.0 \

 --gateway=192.168.6.1 \

 --force  \

 --kernel=/boot/vmlinuz-2.6.24-28-xen \

 --dist=hardy \

 --mirror=http://mirrors.163.com/ubuntu/ \

 --arch=i386 \

 --passwd \

 --dir=/home/eric

5.使用xen-shell 来控制 vps

打开putty 填入 xen 服务器IP地址 输入新建的用户名 eric

xen-shell v1.9

The following commands are available within this shell:

Use of uninitialized value in sprintf at /usr/bin/xen-shell line 1603.

    author -

      boot - Boot the Xen guest.

   console - Gain access to a Xen guest via the serial console.

      exit - Exit the shell.

      help - Show general, or command-specific, help information.

    passwd - Change the password used to access this host.

     pause - This will pause the Xen guest.

      quit - Exit this shell.

    reboot - Reboot the Xen guest.

   reimage - Reset your system to a pristine installation.

    serial - Gain access to the Xen guest via the serial console.

  shutdown - Shutdown the Xen guest.

    status - Show the status of the Xen guest.

    sysreq - Send a 'sysreq' keystroke to the guest.

       top - Show system resource usage.

   unpause - This will unpause the Xen guest.

    uptime - Show the uptime information of your guest system and this host.

   version - Show the version of this shell, and of Xen.

    whoami - Show the user you're connected to the host system as.

For command-specific help run "help command".

xen-shell> 

###下面是 命令介绍 ####

xen-shell> boot 

# 启动vps 

xen-shell> console

# 登录VPS,如果用SSH连不上 VPS,你这样可以登录VPS修改IP地址等。

xen-shell> exit

#  退出 xen-shell

xen-shell> help

# 查看帮助信息,显示命令

xen-shell> passwd 

# 修改用户登录密码

xen-shell>pause

# 将暂停VPS

xen-shell>quit

# 退出 xen-shell

xen-shell>reboot

# 重启 VPS 

xen-shell>reimage

# 重新安装系统

xen-shell>serial

# 也是登录VPS控制台

xen-shell> shutdown

# 关闭 vps 虚拟机

xen-shell> status

# VPS 运行的状态

xen-shell>sysreq

# 发送‘sysreq’按键 到VPS

xen-shell>top

# 显示系统资源使用率

xen-shell>unpause

# 取消暂停

xen-shell>uptime

# 显示您的客户系统和该主机的正常运行时间信息

xen-shell>version

# 显示 xen-shell 和 XEN 的版本信息

xen-shell>whoami

# 显示您已经连接到主机系统的用户。

转载请注明:文章转载自:Eric's linux and nginx! (http://www.nginxs.com)
本文地址:http://www.nginxs.com/linux/185.html

分类: xen 标签: , ,
  1. 2017年12月7日20:33 | #1

    I’d like to find out more? I’d love to find out some additional information.

  2. 2017年12月7日20:44 | #2

    This info is invaluable. How can I find out more?

  3. 2017年12月7日21:02 | #3

    Hi, I would like to subscribe for this weblog to get hottest updates, thus where can i do it please assist.

  4. 2017年12月7日21:09 | #4

    You have made some really good points there. I looked on the web for more information about the issue
    and found most individuals will go along with your views on this
    site.

  5. 2017年12月7日21:17 | #5

    Hey! I realize this is sort of off-topic however I had to ask.
    Does managing a well-established website such as yours require a lot of work?
    I’m brand new to operating a blog however I do write in my
    diary on a daily basis. I’d like to start a blog so
    I will be able to share my personal experience and thoughts online.

    Please let me know if you have any recommendations or tips
    for brand new aspiring bloggers. Appreciate it!

  6. 2017年12月7日21:19 | #6

    I used to be suggested this blog via my cousin. I’m no longer certain whether
    this submit is written through him as nobody else recognize such
    exact about my problem. You are wonderful! Thanks!

  7. 2017年12月7日21:47 | #7

    Comment se faire de l’argent via internet ?

  8. 2017年12月7日21:52 | #8

    avis sur la voyance par telephone jeux voyance gratuite voyance
    100 couple gratuite voyance oui non immediate la voyance
    avis astro chat voyance gratuite voyance gratuite avec voyant virtuel
    arnaque voyance gratuite par telephone voyance gratuite et rapide en ligne voyance serieuse gratuite par telephone sans attente voyance gratuite chat avis voyance tchat en direct gratuite voyance tarot
    gratuite tarot voyance en ligne gratuit voyance gratuite pour le travail chat voyance direct
    voyance telephone paypal voyance finistere 29 voyance
    gratuite tirage carte voyance gratuite par tel pas chere carre magique voyance voyance
    belline gratuite instantane chat gratuit voyance voyance en gratuite en ligne voyance en ligne
    direct gratuit site de voyance serieux gratuit en ligne voyance par sms ca marche voyance
    chateaulin voyance par tchat serieuse voyance tchat en direct gratuite voyance gratuite rencontre amoureuse
    voyance gratuite tarot de belline voyance divinatoire gratuite ligne meilleur
    site voyance par telephone meilleur site de voyance par tchat
    gratuit webcam voyance gratuit voyance gratuite finistere voyance
    carte du pendu cherche voyance gratuite immediate aide
    pour addiction voyance tirage de carte voyance en ligne
    gratuit site de voyance par telephone sans attente voyance en amour gratuite en ligne voyance oui ou non boule voyance benevole tirage
    voyance gratuite en ligne guide voyance tarot gratuit voyance gratuite
    tirage de carte tarot voyance tchat direct gratuit voyance audiotel pas cher

  9. 2017年12月7日22:01 | #9

    Hello there! Would you mind if I share your blog with my zynga group?
    There’s a lot of people that I think would really appreciate your content.
    Please let me know. Many thanks

  10. 2017年12月7日22:16 | #10

    Stockholm Danmark, http://www.aidseducation.org/apotek/vermox , generisk online Danmark.

  11. 2017年12月7日22:17 | #11

    uten resept i Tyskland Danmark, http://www.aquarelagems.com/apotek/azithromycin , kjøpe Norge online.

  12. 2017年12月7日22:31 | #12

    buying cialis in peru
    no prescription cialis
    viagra cialis buy uk

  13. 2017年12月7日22:56 | #13

    Thanks very nice blog!

  14. 2017年12月7日23:32 | #14

    Woah! I’m really enjoying the template/theme of this site.
    It’s simple, yet effective. A lot of times it’s tough to get that “perfect balance” between usability and visual appearance.
    I must say you’ve done a superb job with this. In addition, the blog loads extremely fast for me on Chrome.
    Superb Blog!

  15. 2017年12月7日23:36 | #15

    Excellent post. I was checking constantly this blog and I am impressed!

    Extremely helpful information particularly the last part :
    ) I care for such info a lot. I was seeking this
    certain info for a very long time. Thank you and good luck.

  16. 2017年12月7日23:38 | #16

    Thank you for any other excellent article. Where else may anybody get that kind of information in such an ideal means of writing?

    I’ve a presentation subsequent week, and I am on the search for such info.

  17. 2017年12月7日23:49 | #17

    Thank you for the good writeup. It in fact was a amusement account it.
    Look advanced to more added agreeable from you!
    By the way, how could we communicate?

  18. 2017年12月7日23:58 | #18

    I have learn a few just right stuff here. Definitely worth
    bookmarking for revisiting. I wonder how so much effort
    you set to make this kind of wonderful informative website.

  19. 2017年12月7日23:59 | #19

    I am sure this piece of writing has touched all the internet people, its really really nice
    post on building up new blog.

  20. 2017年12月8日00:10 | #20

    It’s the best time to make a few plans for the long run and it’s time
    to be happy. I’ve read this submit and if I may I wish to suggest you some
    interesting things or suggestions. Perhaps you could write subsequent articles regarding this article.
    I want to read more issues approximately it!

  21. 2017年12月8日00:19 | #21

    Is the FULL ADDRESS (URL) of the hyperlink.

  22. 2017年12月8日00:32 | #22

    Great blog here! Also your site loads up very fast!

    What host are you using? Can I get your affiliate link
    to your host? I wish my web site loaded up as fast as yours lol

  23. 2017年12月8日00:32 | #23

    By kåt brud mogna kvinnor söker män Thaimassage umeå.

  24. 2017年12月8日00:33 | #24

    Quality content is the crucial to attract the visitors to visit the website, that’s
    what this web site is providing.

  25. 2017年12月8日00:40 | #25

    Hi i am kavin, its my first time to commenting anywhere, when i read this piece of
    writing i thought i could also make comment due to this brilliant piece of writing.

  26. 2017年12月8日01:00 | #26

    Maybe so, or perhaps I play because I like gambling and I realize oahu is the only game
    in town. The luckiest are the ones who live in states that respect winners’ privacy.

    This is because by centering on one game, you will have more time
    to examine the sport, analyze the excitement and predict the numbers that will apt to be consumed the next game.

  27. 2017年12月8日01:10 | #27

    Heya i am for the primary time here. I found this board and I in finding It truly helpful & it
    helped me out a lot. I’m hoping to present one thing again and aid others such as you aided me.

  28. 2017年12月8日01:15 | #28

    Thanks for any other excellent post. Where else could anyone get that type of info
    in such a perfect method of writing? I’ve a presentation subsequent week, and I am on the look for such info.

  29. 2017年12月8日01:21 | #29

    pris apotek online, http://www.donaldneff.com/blog/apotek/isoniazid , prissammenligning.

  30. 2017年12月8日01:24 | #30

    This is a topic that is near to my heart… Take care! Exactly where are your contact details though?

  31. 2017年12月8日02:07 | #31

    köp billigt pris, http://www.annecray.com/apotek/calma , generisk billigt Sverige.

  32. 2017年12月8日02:07 | #32

    Nice post. I was checking constantly this blog and
    I’m inspired! Extremely useful info specifically the remaining section :) I deal with such information much.
    I used to be seeking this particular info for a very long
    time. Thank you and good luck.

  33. 2017年12月8日02:08 | #33

    I tгuly love ʏoᥙr website.. Great colors & theme.
    Dіԁ yoս build tһis web site үourself? Ρlease reply
    Ьack aѕ I?m hoping to crеate my ownn personal website and ould ⅼike
    to find out ѡһere yoս got tһis frⲟm or ᴡһɑt thе
    theme is named. Thanks!

  34. 2017年12月8日02:17 | #34

    I visited several sites however the audio quality for audio songs existing at this web page is genuinely fabulous.

  35. 2017年12月8日02:25 | #35

    online casino real money
    online casino no deposit bonus
    free online casino games
    best online casino

  36. 2017年12月8日02:32 | #36

    This iѕ really іnteresting, You’re a very skilleԁ blogger.

    I’ve joined your feed and look forward to seeking more of your magnificent post.
    Alsо, I’ve shared your web site in my social networks!

  37. 2017年12月8日03:09 | #37

    hey there and thank you for your info – I’ve certainly picked up something new from
    right here. I did however expertise a few technical issues using this web site,
    since I experienced to reload the website a lot of times previous to I could get it to load correctly.

    I had been wondering if your hosting is OK?
    Not that I’m complaining, but sluggish loading instances times will very frequently affect your placement in google and
    can damage your high quality score if advertising
    and marketing with Adwords. Anyway I am adding this RSS to my email and can look out for a lot
    more of your respective intriguing content.
    Ensure that you update this again very soon.

  38. 2017年12月8日03:10 | #38

    Can you tell us more about this? I’d love to find out more
    details.

  39. 2017年12月8日04:07 | #39

    Thanks a bunch for sharing this with all people you actually realize what you’re talking approximately!
    Bookmarked. Kindly also consult with my website =).

    We can have a hyperlink exchange contract between us

  40. 2017年12月8日04:28 | #40

    I every time spent my half an hour to read this website’s content all the time along with a mug of coffee.

  41. 2017年12月8日04:30 | #41

    I all the time used to read piece of writing in news
    papers but now as I am a user of net so from now I am using net for
    articles, thanks to web.

  42. 2017年12月8日04:42 | #42

    Wonderful, what a blog it is! This webpage gives valuable data to us, keep it up.

  43. 2017年12月8日04:47 | #43

    Hi there, just became alert to your blog through Google, and found
    that it is truly informative. I am going to watch out for brussels.
    I’ll be grateful if you continue this in future. A lot of people will be benefited from your
    writing. Cheers!

  44. 2017年12月8日04:59 | #44

    DateHookup is a 100% free online dating site unlike other online dating sites.
    Chat for hours with new single women and men without paying for a subscription.

  45. 2017年12月8日05:00 | #45

    You are so cool! I do not think I’ve read through
    something like this before. So wonderful to discover another person with some unique
    thoughts on this issue. Seriously.. many thanks for starting this up.
    This website is one thing that is required on the web, someone with some originality!

  46. 2017年12月8日05:21 | #46

    Thank you for another informative site. Where else may I get that type of information written in such a perfect means?
    I have a venture that I’m simply now operating on, and I
    have been on the look out for such information.

  47. 2017年12月8日05:26 | #47

    First of all I would like to say terrific blog!

    I had a quick question in which I’d like to ask if you don’t mind.
    I was curious to find out how you center yourself and clear your mind before writing.

    I have had a hard time clearing my thoughts in getting
    my ideas out. I do enjoy writing but it just seems like
    the first 10 to 15 minutes are usually lost just trying to figure out how to begin. Any ideas or tips?
    Cheers!

  48. 2017年12月8日05:27 | #48

    Does your site have a contact page? I’m having trouble locating it but,
    I’d like to shoot you an e-mail. I’ve got some recommendations
    for your blog you might be interested in hearing. Either way,
    great website and I look forward to seeing it grow over time.

  49. 2017年12月8日05:35 | #49

    billig säljes, http://www.akeyinthedoor.com/?page_name=avastin , till salu Stockholm.

  50. 2017年12月8日06:06 | #50

    can you buy viagra at walgreens
    viagra online
    viagra pills young men
    [url=http://hqviagrajdr.com/]viagra without a doctor prescription[/url]
    sildenafil citrate wholesale

评论分页
订阅评论
0+7= (必填)