Why does “virsh list --all” shows running as normal user but “shut off” with sudo?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












The server1's correct state is shut off but when i run the command as normal user it shows the state as running for normal user and shut off with sudo



[msingh@localhost VMFiles]$ virsh list --all
Id Name State
----------------------------------------------------
1 server1 running

[msingh@localhost VMFiles]$ sudo virsh list --all
[sudo] password for msingh:
Id Name State
----------------------------------------------------
- generic shut off
- server1 shut off
- server2 shut off
- windows shut off

[msingh@localhost VMFiles]$


here is another command:



[msingh@localhost server1]$ sudo virsh dominfo server1
Id: -
Name: server1
UUID: acd31081-b513-4e46-b2a2-20ad6bb9ac2e
OS Type: hvm
State: shut off
CPU(s): 1
Max memory: 1048576 KiB
Used memory: 1048576 KiB
Persistent: yes
Autostart: disable
Managed save: no
Security model: selinux
Security DOI: 0

[msingh@localhost server1]$ virsh dominfo server1
Id: 1
Name: server1
UUID: 8f6fa56a-b062-424a-9100-7f411df1c28b
OS Type: hvm
State: running
CPU(s): 1
CPU time: 18.8s
Max memory: 1024 KiB
Used memory: 2048 KiB
Persistent: yes
Autostart: disable
Managed save: no
Security model: selinux
Security DOI: 0
Security label: unconfined_u:unconfined_r:svirt_t:s0:c290,c658 (enforcing)






share|improve this question

























    up vote
    0
    down vote

    favorite












    The server1's correct state is shut off but when i run the command as normal user it shows the state as running for normal user and shut off with sudo



    [msingh@localhost VMFiles]$ virsh list --all
    Id Name State
    ----------------------------------------------------
    1 server1 running

    [msingh@localhost VMFiles]$ sudo virsh list --all
    [sudo] password for msingh:
    Id Name State
    ----------------------------------------------------
    - generic shut off
    - server1 shut off
    - server2 shut off
    - windows shut off

    [msingh@localhost VMFiles]$


    here is another command:



    [msingh@localhost server1]$ sudo virsh dominfo server1
    Id: -
    Name: server1
    UUID: acd31081-b513-4e46-b2a2-20ad6bb9ac2e
    OS Type: hvm
    State: shut off
    CPU(s): 1
    Max memory: 1048576 KiB
    Used memory: 1048576 KiB
    Persistent: yes
    Autostart: disable
    Managed save: no
    Security model: selinux
    Security DOI: 0

    [msingh@localhost server1]$ virsh dominfo server1
    Id: 1
    Name: server1
    UUID: 8f6fa56a-b062-424a-9100-7f411df1c28b
    OS Type: hvm
    State: running
    CPU(s): 1
    CPU time: 18.8s
    Max memory: 1024 KiB
    Used memory: 2048 KiB
    Persistent: yes
    Autostart: disable
    Managed save: no
    Security model: selinux
    Security DOI: 0
    Security label: unconfined_u:unconfined_r:svirt_t:s0:c290,c658 (enforcing)






    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      The server1's correct state is shut off but when i run the command as normal user it shows the state as running for normal user and shut off with sudo



      [msingh@localhost VMFiles]$ virsh list --all
      Id Name State
      ----------------------------------------------------
      1 server1 running

      [msingh@localhost VMFiles]$ sudo virsh list --all
      [sudo] password for msingh:
      Id Name State
      ----------------------------------------------------
      - generic shut off
      - server1 shut off
      - server2 shut off
      - windows shut off

      [msingh@localhost VMFiles]$


      here is another command:



      [msingh@localhost server1]$ sudo virsh dominfo server1
      Id: -
      Name: server1
      UUID: acd31081-b513-4e46-b2a2-20ad6bb9ac2e
      OS Type: hvm
      State: shut off
      CPU(s): 1
      Max memory: 1048576 KiB
      Used memory: 1048576 KiB
      Persistent: yes
      Autostart: disable
      Managed save: no
      Security model: selinux
      Security DOI: 0

      [msingh@localhost server1]$ virsh dominfo server1
      Id: 1
      Name: server1
      UUID: 8f6fa56a-b062-424a-9100-7f411df1c28b
      OS Type: hvm
      State: running
      CPU(s): 1
      CPU time: 18.8s
      Max memory: 1024 KiB
      Used memory: 2048 KiB
      Persistent: yes
      Autostart: disable
      Managed save: no
      Security model: selinux
      Security DOI: 0
      Security label: unconfined_u:unconfined_r:svirt_t:s0:c290,c658 (enforcing)






      share|improve this question













      The server1's correct state is shut off but when i run the command as normal user it shows the state as running for normal user and shut off with sudo



      [msingh@localhost VMFiles]$ virsh list --all
      Id Name State
      ----------------------------------------------------
      1 server1 running

      [msingh@localhost VMFiles]$ sudo virsh list --all
      [sudo] password for msingh:
      Id Name State
      ----------------------------------------------------
      - generic shut off
      - server1 shut off
      - server2 shut off
      - windows shut off

      [msingh@localhost VMFiles]$


      here is another command:



      [msingh@localhost server1]$ sudo virsh dominfo server1
      Id: -
      Name: server1
      UUID: acd31081-b513-4e46-b2a2-20ad6bb9ac2e
      OS Type: hvm
      State: shut off
      CPU(s): 1
      Max memory: 1048576 KiB
      Used memory: 1048576 KiB
      Persistent: yes
      Autostart: disable
      Managed save: no
      Security model: selinux
      Security DOI: 0

      [msingh@localhost server1]$ virsh dominfo server1
      Id: 1
      Name: server1
      UUID: 8f6fa56a-b062-424a-9100-7f411df1c28b
      OS Type: hvm
      State: running
      CPU(s): 1
      CPU time: 18.8s
      Max memory: 1024 KiB
      Used memory: 2048 KiB
      Persistent: yes
      Autostart: disable
      Managed save: no
      Security model: selinux
      Security DOI: 0
      Security label: unconfined_u:unconfined_r:svirt_t:s0:c290,c658 (enforcing)








      share|improve this question












      share|improve this question




      share|improve this question








      edited Jun 6 at 18:56









      sourcejedi

      18.1k22375




      18.1k22375









      asked Jun 6 at 12:58









      munish

      2,448144575




      2,448144575




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          By default, sudo virsh will access the system libvirt instance.



          virsh as an unprivileged user, will try to access the libvirt instance for that user.



          You have a VM called server1 in the user instance, and a VM called server1 in the system instance, but these are not the same VM :). Your output shows they have different memory configurations, for example.






          share|improve this answer























            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );








             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f448201%2fwhy-does-virsh-list-all-shows-running-as-normal-user-but-shut-off-with-sud%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            1
            down vote



            accepted










            By default, sudo virsh will access the system libvirt instance.



            virsh as an unprivileged user, will try to access the libvirt instance for that user.



            You have a VM called server1 in the user instance, and a VM called server1 in the system instance, but these are not the same VM :). Your output shows they have different memory configurations, for example.






            share|improve this answer



























              up vote
              1
              down vote



              accepted










              By default, sudo virsh will access the system libvirt instance.



              virsh as an unprivileged user, will try to access the libvirt instance for that user.



              You have a VM called server1 in the user instance, and a VM called server1 in the system instance, but these are not the same VM :). Your output shows they have different memory configurations, for example.






              share|improve this answer

























                up vote
                1
                down vote



                accepted







                up vote
                1
                down vote



                accepted






                By default, sudo virsh will access the system libvirt instance.



                virsh as an unprivileged user, will try to access the libvirt instance for that user.



                You have a VM called server1 in the user instance, and a VM called server1 in the system instance, but these are not the same VM :). Your output shows they have different memory configurations, for example.






                share|improve this answer















                By default, sudo virsh will access the system libvirt instance.



                virsh as an unprivileged user, will try to access the libvirt instance for that user.



                You have a VM called server1 in the user instance, and a VM called server1 in the system instance, but these are not the same VM :). Your output shows they have different memory configurations, for example.







                share|improve this answer















                share|improve this answer



                share|improve this answer








                edited Jun 6 at 18:58


























                answered Jun 6 at 18:53









                sourcejedi

                18.1k22375




                18.1k22375






















                     

                    draft saved


                    draft discarded


























                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f448201%2fwhy-does-virsh-list-all-shows-running-as-normal-user-but-shut-off-with-sud%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    Bahrain

                    Postfix configuration issue with fips on centos 7; mailgun relay